diff --git a/.editorconfig b/.editorconfig
index c308ed0c0..d699abc5a 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,13 +1,13 @@
-# http://editorconfig.org
-root = true
-
-[*]
-indent_style = space
-indent_size = 4
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[*.md]
-trim_trailing_whitespace = false
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.eslintrc.json b/.eslintrc.json
index 5cf14c39a..611db1187 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -82,6 +82,7 @@
"no-lonely-if": "error",
"no-mixed-spaces-and-tabs": "error",
"no-plusplus": "off",
+ "no-prototype-builtins": "off",
"no-trailing-spaces": [ "error", { "skipBlankLines": true, "ignoreComments": true } ],
"no-underscore-dangle": "off",
"no-whitespace-before-property": "error",
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 74ce28264..c0ff122d0 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -22,6 +22,20 @@ Before contributing, please read the [code of conduct](https://github.com/photon
We have a very active [Phaser Support Forum][4]. If you need general support, or are struggling to understand how to do something or need your code checked over, then we would urge you to post it to our forum. There are a lot of friendly devs in there who can help, as well as the core Phaser team, so it's a great place to get support. You're welcome to report bugs directly on GitHub, but for general support we'd always recommend using the forum first.
+## Contribute with online one-click setup
+
+You can use Gitpod (a free online VS Code-like IDE) for contributing. With a single click, it will launch a workspace and automatically:
+
+- clone the `phaser` repo.
+- install the dependencies.
+- run `npm run build`.
+- run `npm run watch`.
+- clone `phaser-3-examples` and afterwards install dependencies and run `npm start` in there.
+
+So that anyone interested in contributing can start straight away.
+
+[](https://gitpod.io/#https://github.com/photonstorm/phaser)
+
## Making Changes
I'm assuming you already have a recent version of [Node](https://nodejs.org) installed locally and can run `npm`. This guide is tested and works on both Windows 10 and OS X.
diff --git a/.gitpod.yml b/.gitpod.yml
new file mode 100644
index 000000000..0e55608cf
--- /dev/null
+++ b/.gitpod.yml
@@ -0,0 +1,13 @@
+tasks:
+ - init: >
+ npm install &&
+ npm run build
+ command: npm run watch
+ - init: >
+ cd ../ &&
+ git clone https://github.com/photonstorm/phaser3-examples.git &&
+ cd phaser3-examples &&
+ npm install && npm start
+ports:
+ - port: 8080
+ onOpen: open-preview
diff --git a/.travis.yml b/.travis.yml
index 77f035aaf..9899608b5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ git:
language: node_js
node_js:
- - '9'
+ - '10'
env:
- TERM=dumb
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d9594dca..e71832404 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,17 +1,280 @@
# Change Log
-## Version 3.23 - Ginro - in development
+## Version 3.50.0 - Subaru - in development
+
+### WebGL Multi-Texture Rendering
+
+The Texture Tint Pipeline has had its core flow rewritten to eliminate the need for constantly creating `batch` objects. Instead, it now supports the new multi-texture shader, vastly increasing rendering performance, especially on drawcall-bound systems.
+
+All of the internal functions, such as `batchQuad` and `batchSprite` have been updated to use the new method of texture setting. The method signatures all remain the same, unless indicated below.
+
+* `Config.render.maxTextures` is a new game config setting that allows you to control how many texture units will be used in WebGL.
+* `WebGL.Utils.checkShaderMax` is a new function, used internally by the renderer, to determine the maximum number of texture units the GPU + browser supports.
+* The property `WebGLRenderer.currentActiveTextureUnit` has been renamed to `currentActiveTexture`.
+* `WebGLRenderer.startActiveTexture` is a new read-only property contains the current starting active texture unit.
+* `WebGLRenderer.maxTextures` is a new read-only property that contains the maximum number of texture units WebGL can use.
+* `WebGLRenderer.textureIndexes` is a new read-only array that contains all of the available WebGL texture units.
+* `WebGLRenderer.tempTextures` is a new read-only array that contains temporary WebGL textures.
+* The `WebGLRenderer.currentTextures` property has been removed, as it's no longer used.
+* `TextureSource.glIndex` is a new property that holds the currently assigned texture unit for the Texture Source.
+* `TextureSource.glIndexCounter` is a new property that holds the time the index was assigned to the Texture Source.
+* `WebGLRenderer.currentTextures` has been removed, as it's no longer used internally.
+* `WebGLRenderer.setBlankTexture` no longer has a `force` parameter, as it's set by default.
+* The Mesh Game Object WebGL Renderer function has been updated to support multi-texture units.
+* The Blitter Game Object WebGL Renderer function has been updated to support multi-texture units.
+* The Bitmap Text Game Object WebGL Renderer function has been updated to support multi-texture units.
+* The Dynamic Bitmap Text Game Object WebGL Renderer function has been updated to support multi-texture units.
+* The Particle Emitter Game Object WebGL Renderer function has been updated to support multi-texture units.
+* The Texture Tint vertex and fragment shaders have been updated to support the `inTexId` float attribute and dynamic generation.
+* The Texture Tint Pipeline has a new attribute, `inTexId` which is a `gl.FLOAT`.
+* `TextureTintPipeline.bind` is a new method that sets the `uMainSampler` uniform.
+* The `TextureTintPipeline.requireTextureBatch` method has been removed, as it's no longer required.
+* The `TextureTintPipeline.pushBatch` method has been removed, as it's no longer required.
+* The `TextureTintPipeline.maxQuads` property has been removed, as it's no longer required.
+* 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.
+* `WebGLRenderer.clearTextureZero` is a new method that clears the texture tha was bound to unit zero.
+* `WebGLRenderer.textureZero` is a new property that holds the currently bound unit zero texture.
+* `WebGLRenderer.normalTexture` is a new property that holds the currently bound normal map (texture unit one).
+* `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.
+
+### Forward Diffuse Light Pipeline API Changes
+
+This Light2D pipeline, which is responsible for rendering lights under WebGL, has been rewritten to work with the new Texture Tint Pipeline functions. Lots of redundant code has been removed and the following changes and improvements took place:
+
+* The pipeline now works with Game Objects that do not have a normal map. They will be rendered using the new default normal map, which allows for a flat light effect to pass over them and merge with their diffuse map colors.
+* 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.
+* 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.
+* 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.
+* The `ForwardDiffuseLightPipeline.boot` method has been changed to now generate a default normal map.
+* The `ForwardDiffuseLightPipeline.onBind` method has been removed as it's no longer required.
+* The `ForwardDiffuseLightPipeline.setNormalMap` method has been removed as it's no longer required.
+* `ForwardDiffuseLightPipeline.bind` is a new method that handles setting-up the shader uniforms.
+* The `ForwardDiffuseLightPipeline.batchTexture` method has been rewritten to use the Texture Tint Pipeline function instead.
+* The `ForwardDiffuseLightPipeline.batchSprite` method has been rewritten to use the Texture Tint Pipeline function instead.
+* `ForwardDiffuseLightPipeline.lightCount` is a new property that stores the previous number of lights rendered.
+* `ForwardDiffuseLightPipeline.getNormalMap` is a new method that will look-up and return a normal map for the given object.
+
+### Lights
+
+* `Light.dirty` is a new property that controls if the light is dirty, or not, and needs its uniforms updating.
+* `Light` has been recoded so that all of its properties are now setters that activate its `dirty` flag.
+* `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
+
+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.
+
+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.
+
+### 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 a per-corner tint color.
+* `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.
+* `BitmapText.getCharacterAt` is a new method that will return the character data from the BitmapText at the given `x` and `y` corodinates. 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.
+* `ParseXMLBitmapFont` will now create a Frame object for each glyph. This means you could, for example, create a Sprite using the BitmapText texture and the glyph as the frame key, i.e.: `this.add.sprite(x, y, fontName, 'A')`.
+* `BitmapTextWord`, `BitmapTextCharacter` and `BitmapTextLines` are three new type defs that are now part of the `BitmapTextSize` config object, as returned by `getTextBounds`. This improves the TypeScript defs and JS Docs for this object.
+* The signature of the `ParseXMLBitmapFont` function has changed. The `frame` parameter is no longer optional, and is now the second parameter in the list, instead of being the 4th. If you call this function directly, please update your code.
+* The `BitmapText.getTextBounds` method was being called every frame, even if the bounds didn't change, potentially costing a lot of CPU time depending on the text length and quantity of them. It now only updates the bounds if they change.
+* The `GetBitmapTextSize` function used `Math.round` on the values, if the `round` parameter was `true`, which didn't create integers. It now uses `Math.ceil` instead to give integer results.
+* The `GetBitmapTextSize` function has a new boolean parameter `updateOrigin`, which will adjust the origin of the parent BitmapText if set, based on the new bounds calculations.
+* `BitmapText.preDestroy` is a new method that will tidy-up all of the BitmapText data during object destruction.
+* `BitmapText.dropShadowX` is a new property that controls the horizontal offset of the drop shadow on the Bitmap Text.
+* `BitmapText.dropShadowY` is a new property that controls the vertical offset of the drop shadow on the Bitmap Text.
+* `BitmapText.dropShadowColor` is a new property that sets the color of the Bitmap Text drop shadow.
+* `BitmapText.dropShadowAlpha` is a new property that sets the alpha of the Bitmap Text drop shadow.
+* `BatchChar` is a new internal private function for batching a single character of a Bitmap Text to the pipeline.
+* If you give an invalid Bitmap Font key, the Bitmap Text object will now issue a `console.warn`.
+* Setting the `color` value in the `DynamicBitmapText.setDisplayCallback` would inverse the red and blue channels if the color was not properly encoded for WebGL. It is now encoded automatically, meaning you can pass normal hex values as the colors in the display callback. Fix #5225 (thanks @teebarjunk)
+* If you apply `setSize` to the Dynamic BitmapText the scissor is now calculated based on the parent transforms, not just the local ones, meaning you can crop Bitmap Text objects that exist within Containers. Fix #4653 (thanks @lgibson02)
+* `ParseXMLBitmapFont` has a new optional parameter `texture`. If defined, this Texture is populated with Frame data, one frame per glyph. This happens automatically when loading Bitmap Text data in Phaser.
+
+### New Features
+
+* `WebGLRenderer.setInt1iv` will allow you to look-up and set a 1iv uniform on the given shader.
+* `Geom.Intersects.GetLineToLine` is a new function that will return a Vector3 containing the point of intersection between 2 line segments, with the `z` property holding the distance value.
+* `Geom.Intersects.GetLineToPolygon` is a new function that checks for the closest point of intersection between a line segment and an array of polygons.
+* `Geom.Polygon.Translate` is a new function that allows you to translate all the points of a polygon by the given values.
+* `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.
+* The `KeyboardPlugin` will now track the key code and timestamp of the previous key pressed and compare it to the current event. If they match, it will skip the event. On some systems if you were to type quickly, you would sometimes get duplicate key events firing (the exact same event firing more than once). This is now prevented from happening.
+* `Display.Color.GetColorFromValue` is a new function that will take a hex color value and return it as an integer, for use in WebGL. This is now used internally by the Tint component and other classes.
+* `Utils.String.RemoveAt` is a new function that will remove a character from the given index in a string and return the new string.
+* `Frame.setUVs` is a new method that allows you to directly set the canvas and UV data for a frame. Use this if you need to override the values set automatically during frame creation.
+
+### Updates and API Changes
+
+* `Config.batchSize` has been increased from 2000 to 4096.
+* 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.
+* The `KeyboardPlugin` no longer emits `keyup_` events. These were replaced with `keyup-` events in v3.15. The previous event string was deprecated in v3.20.
+* The `ScaleManager.updateBounds` method is now called every time the browser fires a 'resize' or 'orientationchange' event. This will update the offset of the canvas element Phaser is rendering to, which is responsible for keeping input positions correct. However, if you change the canvas position, or visibility, via any other method (i.e. via an Angular route) you should call the `updateBounds` method directly, yourself.
+
+### 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.
+* 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)
+* Calling `Rectangle.setSize()` wouldn't change the underlying geometry of the Shape Game Object, causing any stroke to be incorrectly rendered after a size change.
+
+### Examples, Documentation and TypeScript
+
+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
+
+
+
+
+
+
+
+## Version 3.24.1 - Rem - 14th July 2020
+
+* Reverted the PR that added the parent transform to a Static Tilemap Layer as it broke tilemap rendering when the camera was zoomed (thanks @kainage)
+* Fixed an error with the use of the Vector2Like type in the `Math.RotateTo` function that caused a TypeScript error on compilation
+
+## Version 3.24.0 - Rem - 13th July 2020
+
+### Arcade Physics New Features, Updates and Fixes
+
+* When colliding physics groups with the search tree enabled, there was an unnecessary intersection test for each body returned by the search (thanks @samme)
+* When doing an overlap collision, there was an unnecessary intersection test for each pair of overlapping bodies (thanks @samme)
+* Sprite vs. Static Group collision tests now always use the static tree (thanks @samme)
+* Fixed a bug where if you added a static body to a sprite with scale ≠ 1, the body position was incorrect (thanks @samme)
+* If you passed in an array of `children` when creating a Physics Group, they didn't receive bodies. Fix #5152 (thanks @samme)
+* New types allow for better docs / TypeScript defs especially in the Factory functions: `ArcadePhysicsCallback`, `GameObjectWithBody`, `GameObjectWithDynamicBody`, `GameObjectWithStaticBody`, `ImageWithDynamicBody`, `ImageWithStaticBody`, `SpriteWithDynamicBody` and `SpriteWithStaticBody`. Fix #4994 (thanks @samme @gnesher)
+* `Body.updateFromGameObject` is a new method that extracts the relevant code from `preUpdate`, allowing you to read the body's new position and center immediately, before the next physics step. It also lets `refreshBody` work for dynamic bodies, where previously it would error (thanks @samme)
+* Momentum exchange wasn't working correctly vs. immovable bodies. The movable body tended to stop. Fix #4770 (thanks @samme)
+* The Body mass was decreasing the inertia instead of increasing it. Fix #4770 (thanks @samme)
+* The separation vector seemed to be incorrect, causing the slip / slide collisions. The separation is now correct for circle–circle collisions (although not fully for circle–rectangle collisions), part fix #4770 (thanks @samme)
+* The Arcade Body delta was incorrectly calculated on bodies created during the `update` step, causing the position to be off. Fix #5204 (thanks @zackexplosion @samme)
+* `Arcade.Components.Size.setBodySize` is a new method available on Arcade Physics Game Objects that allows you to set the body size. This replaces `setSize` which is now deprecated. Fix #4786 (thanks @wingyplus)
+
+### New Features
+
+* The Animation component has a new property `nextAnimsQueue` which allows you to sequence Sprite animations to play in order, i.e: `this.mole.anims.play('digging').anims.chain('lifting').anims.chain('looking').anims.chain('lowering');` (thanks @tgroborsch)
+* `Group.setActive` is a new method that will set the active state of a Group, just like it does on other Game Objects (thanks @samme)
+* `Group.setName` is a new method that will set the name property of a Group, just like it does on other Game Objects (thanks @samme)
+* `TWEEN_STOP` is a new event dispatched by a Tween when it stops playback (thanks @samme @RollinSafary)
+* You can now specify an `onStop` callback when creating a Tween as part of the tween config, which is invoked when a Tween stops playback (thanks @samme @RollinSafary)
+* Previously, if you created a timeline and passed no tweens in the config, the timeline would be created but all config properties were ignored. Now the timeline's own properties (completeDelay, loop, loopDelay, useFrames, onStart, onUpdate, onLoop, onYoyo, onComplete, etc.) are set from the config properly (thanks @samme)
+* `TextStyle.wordWrapWidth` lets you set the maximum width of a line of text (thanks @mikewesthad)
+* `TextStyle.wordWrapCallback` is a custom function that will is responsible for wrapping the text (thanks @mikewesthad)
+* `TextStyle.wordWrapCallbackScope` is the scope that will be applied when the `wordWrapCallback` is invoked (thanks @mikewesthad)
+* `TextStyle.wordWrapUseAdvanced` controls whether or not to use the advanced wrapping algorithm (thanks @mikewesthad)
+* `KeyboardPlugin.removeAllKeys` is a new method that allows you to automatically remove all Key instances that the plugin has created, making house-keeping a little easier (thanks @samme)
+* `Math.RotateTo` is a new function that will position a point at the given angle and distance (thanks @samme)
+* `Display.Bounds.GetBounds` is a new function that will return the un-transformed bounds of the given Game Object as a Rectangle (thanks @samme)
+
+### Updates
+
+* The `Pointer.dragStartX/YGlobal` and `Pointer.dragX/Y` values are now populated from the `worldX/Y`, which means using those values directly in Input Drag callbacks will now work when the Camera is zoomed. Fix #4755 (thanks @braindx)
+* The `browser` field has been added to the Phaser `package.json` pointing to the `dist/phaser.js` umd build (thanks @FredKSchott)
+* Calling `TimeStep.wake()` while the loop is running will now cause nothing to happen, rather than sleeping and then waking again (thanks @samme)
+* `Container.getBounds` will no longer set the temp rect bounds to the first child of the Container by default (which would error if the child had no bounds, like a Graphics object) and instead sets it as it iterates the children (thanks @blopa)
+* `File.state` will now be set to the `FILE_LOADING` state while loading and `FILE_LOADED` after loading (thanks @samme)
+* `BaseCamera.cull` now moves some of its calculations outside of the cull loop to speed it up (thanks @samme)
+* `SceneManager.createSceneFromInstance` had a small refactor to avoid a pointless condition (thanks @samme)
+
+### Bug Fixes
+
+* Fixed a TypeError warning when importing JSON objects directly to the `url` argument of any of the Loader filetypes. Fix #5189 (thanks @awweather @samme)
+* The `NOOP` function was incorrectly imported by the Mouse and Keyboard Manager. Fix #5170 (thanks @samme @gregolai)
+* When Audio files failed to decode on loading, they would always show 'undefined' as the key in the error log, now they show the actual key (thanks @samme)
+* When the Sprite Sheet parser results in zero frames, the warning will now tell you the texture name that caused it (thanks @samme)
+* `KeyboardPlugin.checkDown` didn't set the `duration` to zero if the parameter was omitted, causing it to always return false. Fix #5146 (thanks @lozzajp)
+* If you passed in an array of `children` when creating a Group, they were not added and removed correctly. Fix #5151 (thanks @samme)
+* When using HTML5 Audio with `pauseOnBlur` (the default), if you play a sound, schedule stopping the sound (e.g., timer, tween complete callback), leave the page, and return to the page, the sound `stop()` will error (thanks @samme)
+* Using a Render Texture when you're also using the headless renderer would cause an error (thanks @samme)
+* `Ellipse.setWidth` would incorrectly set the `xRadius` to the diameter (thanks @rexrainbow)
+* `Ellipse.setHeight` would incorrectly set the `yRadius` to the diameter (thanks @rexrainbow)
+* When specifically setting the `parent` property in the Game Config to `null` the canvas was appended to the document body, when it should have been ignored (allowing you to add it to the dom directly). Fix #5191 (thanks @MerganThePirate)
+* Containers will now apply nested masks correctly when using the Canvas Renderer specifically (thanks @scott20145)
+* Calling `Scale.startFullScreen` would fail in Safari on Mac OS, throwing a `fullscreenfailed` error. It now triggers fullscreen mode correctly, as on other browsers. Fix #5143 (thanks @samme @novaknole)
+* Calling `setCrop` on a Matter Physics Sprite would throw a TypeError, but will now crop correctly. Not that it only crops the texture, the body is unaffected. Fix #5211 (thanks @MatthewRorke @samme)
+* The Static Tilemap Layer would ignore the layer rotation and parent transform when using WebGL (but worked in Canvas). Both modes now work in the same manner (thanks @cruzdanilo)
+* Calling `getTextBounds` on a BitmapText object would return the incorrect values if the origin had been changed, but the text itself had not, as it was using out of date dimensions. Changing the origin now automatically triggers BitmapText to be dirty, forcing the bounds to be refreshed. Fix #5121 (thanks @thenonamezz)
+* The ISO Triangle shape would skip rendering the left side of the first triangle in the batch. It now renders all ISO Triangles correctly. Fix #5164 (thanks @mattjennings)
+
+### Examples, Documentation and TypeScript
+
+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 @SanderVanhove @SirJosh3917 @mooreInteractive @A-312 @lozzajp @mikewesthad @j-waters @futuremarc
+
+## Version 3.23 - Ginro - 27th April 2020
### JSDocs
-The following sections now have 100% complete JSDoc coverage:
+The entire Phaser 3 API now has 100% complete JSDoc coverage!
+
+The following sections had their documentation completed in this release:
* Animations
* Create
+* Curves
* Geom
* Math
* Renderer
* Textures
+* Tilemaps
### Removed
@@ -25,6 +288,13 @@ The following features are now deprecated and will be removed in a future versio
* The Light Pipeline and associated components will be removed. This feature was never properly finished and adds too much redundant, non-optional code into the core API. The ability to load normal maps alongside textures will _remain_, for use in your own lighting shaders, which gives you far more control over the final effect.
+### New: Rope Game Object
+
+This version of Phaser contains the brand new Rope Game Object. A Rope is a special kind of Game Object that has a repeating texture that runs in a strip, either horizontally or vertically. Unlike a Sprite, you can define how many vertices the Rope has, and can modify each of them during run-time, allowing for some really lovely effects.
+
+Ropes can be created via the Game Object Factory in the normal way (`this.add.rope()`) and you should look at the examples and documentation for further implementation details.
+
+Note that Ropes are a WebGL only feature.
### New Features
@@ -33,6 +303,33 @@ The following features are now deprecated and will be removed in a future versio
* `Config.loaderWithCredentials` is the new global setting for `XHRSettings.withCredentials`.
* `Camera.renderToGame` is a new property used in conjunction with `renderToTexture`. It controls if the Camera should still render to the Game canvas after rendering to its own texture or not. By default, it will render to both, but you can now toggle this at run-time.
* `Camera.setRenderToTexture` has a new optional parameter `renderToGame` which sets the `Camera.renderToGame` property, controlling if the Camera should render to both its texture and the Game canvas, or just its texture.
+* The free version of Texture Packer exports a `pivot` property when using JSON Array or Hash, however the Texture Packer Phaser export uses the `anchor` property. This update allows the loaders to work with either property, regardless of which export you use (thanks @veleek)
+* `get()` is a new method in the HTML and Web Audio Sound Managers that will get the first sound in the manager matching the given key, if any (thanks @samme)
+* `getAll()` is a new method in the HTML and Web Audio Sound Managers that will get all sounds in the manager matching the given key, if any (thanks @samme)
+* `removeAll()` is a new method in the HTML and Web Audio Sound Managers that will remove all sounds in the manager, destroying them (thanks @samme)
+* `stopByKey()` is a new method in the HTML and Web Audio Sound Managers that will stop any sound in the manager matching the given key, if any (thanks @samme)
+* `Rectangle.FromXY` is a new function that will create the smallest Rectangle containing two coordinate pairs, handy for marquee style selections (thanks @samme)
+* `PathFollower.pathDelta` is a new property that holds the distance the follower has traveled from the previous point to the current one, at the last update (thanks @samme)
+* `Vector2.fuzzyEquals` is a new method that will check whether the Vector is approximately equal to a given Vector (thanks @samme)
+* `Vector2.setAngle` is a new method that will set the angle of the Vector (thanks @samme)
+* `Vector2.setLength` is a new method that will set the length, or magnitude of the Vector (thanks @samme)
+* `Vector2.normalizeLeftHand` is a new method that will rotate the Vector to its perpendicular, in the negative direction (thanks @samme)
+* `Vector2.limit` is a new method that will limit the length, or magnitude of the Vector (thanks @samme)
+* `Vector2.reflect` is a new method that will reflect the Vector off a line defined by a normal (thanks @samme)
+* `Vector2.mirror` is a new method that will reflect the Vector across another (thanks @samme)
+* `Vector2.rotate` is a new method that will rotate the Vector by an angle amount (thanks @samme)
+* `Math.Angle.Random` is a new function that will return a random angle in radians between -pi and pi (thanks @samme)
+* `Math.Angle.RandomDegrees` is a new function that will return a random angle in degrees between -180 and 180 (thanks @samme)
+* `Physics.Arcade.World.fixedStep` is a new boolean property that synchronizes the physics fps to the rendering fps when enabled. This can help in some cases where "glitches" can occur in the movement of objects. These glitches are especially noticeable on objects that move at constant speed and the fps are not consistent. Enabling this feature disables the fps and timeScale properties of the Arcade.World class (thanks @jjcapellan)
+* `Curves.Path.getTangent` is a new method that gets a unit vector tangent at a relative position on the path (thanks @samme)
+* `DataManager.inc` is a new method that will increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0 (thanks @rexrainbow)
+* `DataManager.toggle` is a new method that will 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 (thanks @rexrainbow)
+* The Tiled parser will now recognize Tiled `point objects` and export them with `point: true`. Equally, Sprites generated via `createFromObjects` are now just set to the position of the Point object, using the Sprites dimensions. This is a breaking change, so if you are using Point objects and `createFromObjects` please re-test your maps against this release of Phaser (thanks @samme)
+* You can now use Blob URLs when loading `Audio` objects via the Loader (thanks @aucguy)
+* You can now use Blob URLs when loading `Video` objects via the Loader (thanks @aucguy)
+* Tiled Image Collections now have rudimentary support and will create a single tileset per image. This is useful for prototyping, but should not be used heavily in production. See #4964 (thanks @gogoprog)
+* When loading files using your own XHR Settings you can now use the new property `headers` to define an object containing multiple headers, all of which will be sent with the xhr request (thanks @jorbascrumps)
+* `Camera.rotateTo` is a new Camera effect that allows you to set the rotation of the camera to a given value of the duration specified (thanks @jan1za)
### Updates
@@ -40,6 +337,12 @@ The following features are now deprecated and will be removed in a future versio
* `Animation.setCurrentFrame` will no longer try to call `setOrigin` or `updateDisplayOrigin` if the Game Object doesn't have the Origin component, preventing unknown function errors.
* `MatterTileBody` now extends `EventEmitter`, meaning you can listen to collision events from Tiles directly and it will no longer throw errors about `gameObject.emit` not working. Fix #4967 (thanks @reinildo)
* Added `MatterJS.BodyType` to `GameObject.body` type. Fix #4962 (thanks @meisterpeeps)
+* The `JSONHash` loader didn't load custom pivot information, but `JSONArray` did. So that functionality has been duplicated into the `JSONHash` file type (thanks @veleek)
+* When enabling a Game Object for input debug, the debug body's depth was 0. It's now set to be the same depth as the actual Game Object (thanks @mktcode)
+* Spine Files can now be loaded via a manifest, allowing you to specify a prefix in the loader object and providing absolute paths to textures. Fix #4813 (thanks @FostUK @a610569731)
+* `collideSpriteVsGroup` now exits early when the Sprite has `checkCollision.none`, skipping an unnecessary iteration of the group (thanks @samme)
+* `collideSpriteVsGroup` when looping through the tree results now skips bodies with `checkCollision.none` (thanks @samme)
+* When enabling a Game Object for Input Debugging the created debug shape will now factor in the position, scale and rotation of the Game Objects parent Container, if it has one (thanks @scott20145)
### Bug Fixes
@@ -49,12 +352,39 @@ The following features are now deprecated and will be removed in a future versio
* The `Arcade Physics Static Body` center was incorrect after construction. Probably caused problems with circle collisions. Fix #4770 (thanks @samme)
* An Arcade Physics Body `center` and `position` are now correct after construction and before preUpdate(), for any Game Object origin or scale (thanks @samme)
* When calling `Body.setSize` with the `center` parameter as `true` the calculated offset would be incorrect for scaled Game Objects. The offset now takes scaling into consideration (thanks @samme)
+* `HTML5AudioFile.load` would throw an error in strict mode (thanks @samme)
+* When using the `No Audio` Sound Manager, calling `destroy()` would cause a Maximum call stack size exceeded error as it was missing 6 setter methods. It will now destroy properly (thanks @samme)
+* When using HTML5 Audio, setting the game or sound volume outside of the range 0-1 would throw an index size error. The value is now clamped before being set (thanks @samme)
+* Sound Managers were still listening to Game BLUR, FOCUS, and PRE_STEP events after being destroyed. These events are now cleared up properly (thanks @samme)
+* In WebGL, the `TextureTintPipeline` is now set before rendering any camera effects. If the pipeline had been changed, the effects would not run (thanks @TroKEMp)
+* When transitioning to a sleeping Scene, the transition `data` wasn't sent to the Scene `wake` method. It's now sent across to both sleeping and waking scenes. Fix #5078 (thanks @MrMadClown)
+* `Scale.lockOrientation('portrait')` would throw a runtime error in Firefox: 'TypeError: 'mozLockOrientation' called on an object that does not implement interface Screen.' It no longer does this. Fix #5069 (thanks @123survesh)
+* The `FILE_COMPLETE` event was being emitted twice for a JSON loaded animation file. It now only fires once. Fix #5059 (thanks @jjcapellan)
+* If you restart or stop / start a scene and then queue at least one new file in `preload`, the scenes `update` function is called before `create`, likely causing an error. Fix #5065 (thanks @samme)
+* `Circle.GetPoints` will now check that `stepRate` is > 0 to avoid division by zero errors leading to the quantity becoming infinity (thanks @jdcook)
+* `Ellipse.GetPoints` will now check that `stepRate` is > 0 to avoid division by zero errors leading to the quantity becoming infinity (thanks @jdcook)
+* `Line.GetPoints` will now check that `stepRate` is > 0 to avoid division by zero errors leading to the quantity becoming infinity (thanks @jdcook)
+* `Polygon.GetPoints` will now check that `stepRate` is > 0 to avoid division by zero errors leading to the quantity becoming infinity (thanks @jdcook)
+* `Rectangle.GetPoints` will now check that `stepRate` is > 0 to avoid division by zero errors leading to the quantity becoming infinity (thanks @jdcook)
+* `Triangle.GetPoints` will now check that `stepRate` is > 0 to avoid division by zero errors leading to the quantity becoming infinity (thanks @jdcook)
+* Changing the game size with a scale mode of FIT resulted in a canvas with a incorrect aspect ratio. Fix #4971 (thanks @Kitsee @samme)
+* The Matter Physics `Common.isString` function would cause a 'TypeError: Invalid calling object' in Internet Explorer (thanks @samme)
+* `Arcade.Body.checkCollision.none` did not prevent collisions with Tiles. Now it does (thanks @samme)
+* When running in HEADLESS mode, using a `Text` Game Object would cause a runtime error "Cannot read property gl of null". Fix #4976 (thanks @raimon-segura @samme)
+* The Tilemap `LayerData` class `properties` property has been changed from 'object' to an array of objects, which is what Tiled exports when defining layer properties in the editor. Fix #4983 (thanks @Nightspeller)
+* `AudioFile` and `VideoFile` had their state set to `undefined` instead of `FILE_PROCESSING` (thanks @samme)
+* `Container.getBounds` would return incorrect values if it had child Containers within it. Fix #4580 (thanks @Minious @thedrint)
+* The Loader no longer prepends the current path to the URL if it's a Blob object (thanks @aucguy)
+* Spine Atlases can now be loaded correctly via Asset Packs, as they now have the right index applied to them (thanks @jdcook)
+* Input events for children inside nested Containers would incorrectly fire depending on the pointer position (thanks @rexrainbow)
+* Animations with both `yoyo` and `repeatDelay` set will respect the delay after each yoyo runs (thanks @cruzdanilo)
+* `CanvasTexture.setSize` forgot to update the `width` and `height` properties of the Texture itself. These now match the underlying canvas element. Fix #5054 (thanks @sebbernery)
### Examples, Documentation and TypeScript
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:
-@JasonHK @supertommy @majalon @samme
+@JasonHK @supertommy @majalon @samme @MartinBlackburn @halilcakar @jcyuan @MrMadClown @Dinozor @EmilSV @Jazcash
## Version 3.22 - Kohaku - January 15th 2020
diff --git a/README.md b/README.md
index c82db1e97..42109e957 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ Thousands of developers from indie and multi-national digital agencies, and univ
**Learn:** [API Docs](https://photonstorm.github.io/phaser3-docs/index.html), [Support Forum][forum] and [StackOverflow](https://stackoverflow.com/questions/tagged/phaser-framework)
**Code:** 1700+ [Examples](https://phaser.io/examples) (source available in this [repo][examples])
**Read:** The [Phaser World](#newsletter) Newsletter
-**Chat:** [Discord](https://phaser.io/community/discord) and [Slack](https://phaser.io/community/slack)
+**Discord:** Join us on [Discord](https://phaser.io/community/discord)
**Extend:** With [Phaser Plugins](https://phaser.io/shop/plugins)
**Be awesome:** [Support](#support) the future of Phaser
@@ -27,21 +27,17 @@ Grab the source and join the fun!
-> 15th January 2020
+> 13th July 2020
-We're excited to announce the release of Phaser 3.22, the first of many in the year 2020. The main focus of 3.22 is all the work we've done on Matter Physics integration. Matter has been supported in Phaser since the first release, yet there were lots of things we wanted to do with it to make development life easier. 3.22 brings all of these to the front, including powerful new visual debugging options such as rendering contacts, velocity, the broadphase grid, sensors, joints and more. Matter also now has 100% JSDoc and TypeScript coverage and I spent a long time rebuilding the TypeScript defs by hand, in order to make them as accurate as possible.
+I'm pleased to announce the immediate availability of Phaser 3.24. This release is primarily a maintenance release, with the focus mostly on bug fixes and updates. Even so, there are over 70 updates in this version alone. From improvements to the Arcade Physics system, to new Tween events and the ability to chain multiple animations, to some important fixes. If you're currently using 3.23 then we recommend this upgrade. As usual, I'd like to send my thanks to the Phaser community for their help in both reporting issues and submitting pull requests to fix them.
-As well as docs and defs there are stacks of handy new methods, including intersection tests such as `intersectPoint`, `intersectRay`, `overlap` and more. New Body level collision callbacks allow you to filter collided pairs a lot more quickly now, combined with new collision events and data type defs to give you all the information you need when resolving. There are now functions to create bodies from SVG data, JSON data or Physics Editor data directly, new Body alignment features and of course bug fixes.
+So, please do spend some time digging through the [Change Log](#changelog). I assure you, it's worth while :)
-It's not all about Matter Physics, though. Thanks to the community, there are new Math Distance functions such as Chebyshev, Snake and Squared Points. You can now tint particles as they're emitted, Physics Groups finally let you use your own creation and removal callbacks and plenty more besides. There are, of course, lots of bug fixes too and I've done my best to address some of the most important ones. The documentation has improved yet again and with every release the TypeScript defs get stronger and stronger. So, as usual, 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!
-With 3.22 released I will now be taking some time to carry on with Phaser 4 development, while planning out the 3.23 release as well. Even though Phaser 4 is in build I will fully support Phaser 3 for the foreseeable future. You can follow the development progress of both versions on the Phaser Patreon.
+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.
-As usual, I'd like to send a massive thank-you to everyone who supports Phaser on Patreon (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!
-
-If you'd like to stay abreast of developments then I publish my [Developer Logs](https://phaser.io/phaser3/devlog) in the [Phaser World](https://phaser.io/community/newsletter) newsletter. Subscribe to stay in touch and get all the latest news from the core team and the wider community.
-
-You can also follow Phaser on [Twitter](https://twitter.com/phaser_) and chat with fellow Phaser devs in our [Discord](https://phaser.io/community/discord) and [Slack](https://phaser.io/community/slack) channels.
+You can also follow Phaser on [Twitter](https://twitter.com/phaser_) and chat with fellow Phaser devs in our [Discord](https://phaser.io/community/discord).
Phaser 3 wouldn't have been possible without the fantastic support of the community and Patreon. Thank you to everyone who supports our work, who shares our belief in the future of HTML5 gaming, and Phaser's role in that.
@@ -77,18 +73,11 @@ Extra special thanks to the following companies who's support makes Phaser possi
* [Mozilla](https://www.mozilla.org)
* [Texture Packer](https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?utm_source=ad&utm_medium=banner&utm_campaign=phaser-2018-10-16)
* [Twilio](https://www.twilio.com)
-* [Y8 Games](https://www.y8.com)
* [Poki](https://developers.poki.com/)
+* [CrazyGames](https://www.crazygames.com)
+* [Lagged](https://www.lagged.com)
-
-
-
-
-
`
* then this property is a direct reference to that element within the dom.
- *
+ *
* @name Phaser.GameObjects.DOMElement#node
* @type {Element}
* @since 3.17.0
@@ -80659,10 +83603,10 @@ var DOMElement = new Class({
* updated when its rendered. If, for some reason, you don't want any of these changed other than the
* CSS transform, then set this flag to `true`. When `true` only the CSS Transform is applied and it's
* up to you to keep track of and set the other properties as required.
- *
+ *
* This can be handy if, for example, you've a nested DOM Element and you don't want the opacity to be
* picked-up by any of its children.
- *
+ *
* @name Phaser.GameObjects.DOMElement#transformOnly
* @type {boolean}
* @since 3.17.0
@@ -80671,9 +83615,9 @@ var DOMElement = new Class({
/**
* The angle, in radians, by which to skew the DOM Element on the horizontal axis.
- *
+ *
* https://developer.mozilla.org/en-US/docs/Web/CSS/transform
- *
+ *
* @name Phaser.GameObjects.DOMElement#skewX
* @type {number}
* @since 3.17.0
@@ -80682,9 +83626,9 @@ var DOMElement = new Class({
/**
* The angle, in radians, by which to skew the DOM Element on the vertical axis.
- *
+ *
* https://developer.mozilla.org/en-US/docs/Web/CSS/transform
- *
+ *
* @name Phaser.GameObjects.DOMElement#skewY
* @type {number}
* @since 3.17.0
@@ -80693,13 +83637,13 @@ var DOMElement = new Class({
/**
* A Vector4 that contains the 3D rotation of this DOM Element around a fixed axis in 3D space.
- *
+ *
* All values in the Vector4 are treated as degrees, unless the `rotate3dAngle` property is changed.
- *
+ *
* For more details see the following MDN page:
- *
+ *
* https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d
- *
+ *
* @name Phaser.GameObjects.DOMElement#rotate3d
* @type {Phaser.Math.Vector4}
* @since 3.17.0
@@ -80709,9 +83653,9 @@ var DOMElement = new Class({
/**
* The unit that represents the 3D rotation values. By default this is `deg` for degrees, but can
* be changed to any supported unit. See this page for further details:
- *
+ *
* https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d
- *
+ *
* @name Phaser.GameObjects.DOMElement#rotate3dAngle
* @type {string}
* @since 3.17.0
@@ -80720,11 +83664,11 @@ var DOMElement = new Class({
/**
* The native (un-scaled) width of this Game Object.
- *
+ *
* For a DOM Element this property is read-only.
- *
+ *
* The property `displayWidth` holds the computed bounds of this DOM Element, factoring in scaling.
- *
+ *
* @name Phaser.GameObjects.DOMElement#width
* @type {number}
* @readonly
@@ -80734,11 +83678,11 @@ var DOMElement = new Class({
/**
* The native (un-scaled) height of this Game Object.
- *
+ *
* For a DOM Element this property is read-only.
- *
+ *
* The property `displayHeight` holds the computed bounds of this DOM Element, factoring in scaling.
- *
+ *
* @name Phaser.GameObjects.DOMElement#height
* @type {number}
* @readonly
@@ -80748,9 +83692,9 @@ var DOMElement = new Class({
/**
* The computed display width of this Game Object, based on the `getBoundingClientRect` DOM call.
- *
+ *
* The property `width` holds the un-scaled width of this DOM Element.
- *
+ *
* @name Phaser.GameObjects.DOMElement#displayWidth
* @type {number}
* @readonly
@@ -80760,9 +83704,9 @@ var DOMElement = new Class({
/**
* The computed display height of this Game Object, based on the `getBoundingClientRect` DOM call.
- *
+ *
* The property `height` holds the un-scaled height of this DOM Element.
- *
+ *
* @name Phaser.GameObjects.DOMElement#displayHeight
* @type {number}
* @readonly
@@ -80772,7 +83716,7 @@ var DOMElement = new Class({
/**
* Internal native event handler.
- *
+ *
* @name Phaser.GameObjects.DOMElement#handler
* @type {number}
* @private
@@ -80816,7 +83760,7 @@ var DOMElement = new Class({
{
var node = this.node;
var style = node.style;
-
+
if (node)
{
style.display = (sys.settings.visible) ? 'block' : 'none';
@@ -80825,7 +83769,7 @@ var DOMElement = new Class({
/**
* Sets the horizontal and vertical skew values of this DOM Element.
- *
+ *
* For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/transform
*
* @method Phaser.GameObjects.DOMElement#setSkew
@@ -80833,7 +83777,7 @@ var DOMElement = new Class({
*
* @param {number} [x=0] - The angle, in radians, by which to skew the DOM Element on the horizontal axis.
* @param {number} [y=x] - The angle, in radians, by which to skew the DOM Element on the vertical axis.
- *
+ *
* @return {this} This DOM Element instance.
*/
setSkew: function (x, y)
@@ -80852,16 +83796,16 @@ var DOMElement = new Class({
* plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with
* z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined
* by the value of this property.
- *
+ *
* For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective
- *
+ *
* **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.**
*
* @method Phaser.GameObjects.DOMElement#setPerspective
* @since 3.17.0
*
* @param {number} value - The perspective value, in pixels, that determines the distance between the z plane and the user.
- *
+ *
* @return {this} This DOM Element instance.
*/
setPerspective: function (value)
@@ -80876,11 +83820,11 @@ var DOMElement = new Class({
* plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with
* z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined
* by the value of this property.
- *
+ *
* For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective
- *
+ *
* **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.**
- *
+ *
* @name Phaser.GameObjects.DOMElement#perspective
* @type {number}
* @since 3.17.0
@@ -80902,14 +83846,14 @@ var DOMElement = new Class({
/**
* Adds one or more native DOM event listeners onto the underlying Element of this Game Object.
* The event is then dispatched via this Game Objects standard event emitter.
- *
+ *
* For example:
- *
+ *
* ```javascript
* var div = this.add.dom(x, y, element);
- *
+ *
* div.addListener('click');
- *
+ *
* div.on('click', handler);
* ```
*
@@ -80917,7 +83861,7 @@ var DOMElement = new Class({
* @since 3.17.0
*
* @param {string} events - The DOM event/s to listen for. You can specify multiple events by separating them with spaces.
- *
+ *
* @return {this} This DOM Element instance.
*/
addListener: function (events)
@@ -80942,7 +83886,7 @@ var DOMElement = new Class({
* @since 3.17.0
*
* @param {string} events - The DOM event/s to stop listening for. You can specify multiple events by separating them with spaces.
- *
+ *
* @return {this} This DOM Element instance.
*/
removeListener: function (events)
@@ -80977,22 +83921,22 @@ var DOMElement = new Class({
/**
* Creates a native DOM Element, adds it to the parent DOM Container and then binds it to this Game Object,
* so you can control it. The `tagName` should be a string and is passed to `document.createElement`:
- *
+ *
* ```javascript
* this.add.dom().createElement('div');
* ```
- *
+ *
* For more details on acceptable tag names see: https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
- *
+ *
* You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText`
* value as well. Here is an example of a DOMString:
- *
+ *
* ```javascript
* this.add.dom().createElement('div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser');
* ```
- *
+ *
* And using a style object:
- *
+ *
* ```javascript
* var style = {
* 'background-color': 'lime';
@@ -81000,10 +83944,10 @@ var DOMElement = new Class({
* 'height': '100px';
* 'font': '48px Arial';
* };
- *
+ *
* this.add.dom().createElement('div', style, 'Phaser');
* ```
- *
+ *
* If this Game Object already has an Element, it is removed from the DOM entirely first.
* Any event listeners you may have previously created will need to be re-created after this call.
*
@@ -81013,7 +83957,7 @@ var DOMElement = new Class({
* @param {string} tagName - A string that specifies the type of element to be created. The nodeName of the created element is initialized with the value of tagName. Don't use qualified names (like "html:a") with this method.
* @param {(string|any)} [style] - Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from.
* @param {string} [innerText] - A DOMString that holds the text that will be set as the innerText of the created element.
- *
+ *
* @return {this} This DOM Element instance.
*/
createElement: function (tagName, style, innerText)
@@ -81024,34 +83968,34 @@ var DOMElement = new Class({
/**
* Binds a new DOM Element to this Game Object. If this Game Object already has an Element it is removed from the DOM
* entirely first. Any event listeners you may have previously created will need to be re-created on the new element.
- *
+ *
* The `element` argument you pass to this method can be either a string tagName:
- *
+ *
* ```javascript
*
Phaser
*
* this.add.dom().setElement('heading');
* ```
- *
+ *
* Or a reference to an Element instance:
- *
+ *
* ```javascript
*
Phaser
*
* var h1 = document.getElementById('heading');
- *
+ *
* this.add.dom().setElement(h1);
* ```
- *
+ *
* You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText`
* value as well. Here is an example of a DOMString:
- *
+ *
* ```javascript
* this.add.dom().setElement(h1, 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser');
* ```
- *
+ *
* And using a style object:
- *
+ *
* ```javascript
* var style = {
* 'background-color': 'lime';
@@ -81059,7 +84003,7 @@ var DOMElement = new Class({
* 'height': '100px';
* 'font': '48px Arial';
* };
- *
+ *
* this.add.dom().setElement(h1, style, 'Phaser');
* ```
*
@@ -81069,7 +84013,7 @@ var DOMElement = new Class({
* @param {(string|Element)} element - If a string it is passed to `getElementById()`, or it should be a reference to an existing Element.
* @param {(string|any)} [style] - Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from.
* @param {string} [innerText] - A DOMString that holds the text that will be set as the innerText of the created element.
- *
+ *
* @return {this} This DOM Element instance.
*/
setElement: function (element, style, innerText)
@@ -81143,38 +84087,38 @@ var DOMElement = new Class({
* Takes a block of html from the HTML Cache, that has previously been preloaded into the game, and then
* creates a DOM Element from it. The loaded HTML is set as the `innerHTML` property of the created
* element.
- *
+ *
* Assume the following html is stored in a file called `loginform.html`:
- *
+ *
* ```html
*
*
* ```
- *
+ *
* Which is loaded into your game using the cache key 'login':
- *
+ *
* ```javascript
* this.load.html('login', 'assets/loginform.html');
* ```
- *
+ *
* You can create a DOM Element from it using the cache key:
- *
+ *
* ```javascript
* this.add.dom().createFromCache('login');
* ```
- *
+ *
* The optional `elementType` argument controls the container that is created, into which the loaded html is inserted.
* The default is a plain `div` object, but any valid tagName can be given.
- *
+ *
* If this Game Object already has an Element, it is removed from the DOM entirely first.
* Any event listeners you may have previously created will need to be re-created after this call.
*
* @method Phaser.GameObjects.DOMElement#createFromCache
* @since 3.17.0
- *
+ *
* @param {string} The key of the html cache entry to use for this DOM Element.
* @param {string} [tagName='div'] - The tag name of the element into which all of the loaded html will be inserted. Defaults to a plain div tag.
- *
+ *
* @return {this} This DOM Element instance.
*/
createFromCache: function (key, tagName)
@@ -81192,32 +84136,32 @@ var DOMElement = new Class({
/**
* Takes a string of html and then creates a DOM Element from it. The HTML is set as the `innerHTML`
* property of the created element.
- *
+ *
* ```javascript
* let form = `
*
*
* `;
* ```
- *
+ *
* You can create a DOM Element from it using the string:
- *
+ *
* ```javascript
* this.add.dom().createFromHTML(form);
* ```
- *
+ *
* The optional `elementType` argument controls the type of container that is created, into which the html is inserted.
* The default is a plain `div` object, but any valid tagName can be given.
- *
+ *
* If this Game Object already has an Element, it is removed from the DOM entirely first.
* Any event listeners you may have previously created will need to be re-created after this call.
*
* @method Phaser.GameObjects.DOMElement#createFromHTML
* @since 3.17.0
- *
+ *
* @param {string} A string of html to be set as the `innerHTML` property of the created element.
* @param {string} [tagName='div'] - The tag name of the element into which all of the html will be inserted. Defaults to a plain div tag.
- *
+ *
* @return {this} This DOM Element instance.
*/
createFromHTML: function (html, tagName)
@@ -81255,7 +84199,7 @@ var DOMElement = new Class({
*
* @method Phaser.GameObjects.DOMElement#removeElement
* @since 3.17.0
- *
+ *
* @return {this} This DOM Element instance.
*/
removeElement: function ()
@@ -81274,12 +84218,12 @@ var DOMElement = new Class({
* Internal method that calls `getBoundingClientRect` on the `node` and then sets the bounds width
* and height into the `displayWidth` and `displayHeight` properties, and the `clientWidth` and `clientHeight`
* values into the `width` and `height` properties respectively.
- *
+ *
* This is called automatically whenever a new element is created or set.
*
* @method Phaser.GameObjects.DOMElement#updateSize
* @since 3.17.0
- *
+ *
* @return {this} This DOM Element instance.
*/
updateSize: function ()
@@ -81304,10 +84248,10 @@ var DOMElement = new Class({
*
* @method Phaser.GameObjects.DOMElement#getChildByProperty
* @since 3.17.0
- *
+ *
* @param {string} property - The property to search the children for.
* @param {string} value - The value the property must strictly equal.
- *
+ *
* @return {?Element} The first matching child DOM Element, or `null` if not found.
*/
getChildByProperty: function (property, value)
@@ -81331,14 +84275,14 @@ var DOMElement = new Class({
/**
* Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through
* them, looking for the first one that has a matching id. It then returns this child if found, or `null` if not.
- *
+ *
* Be aware that class and id names are case-sensitive.
*
* @method Phaser.GameObjects.DOMElement#getChildByID
* @since 3.17.0
- *
+ *
* @param {string} id - The id to search the children for.
- *
+ *
* @return {?Element} The first matching child DOM Element, or `null` if not found.
*/
getChildByID: function (id)
@@ -81349,14 +84293,14 @@ var DOMElement = new Class({
/**
* Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through
* them, looking for the first one that has a matching name. It then returns this child if found, or `null` if not.
- *
+ *
* Be aware that class and id names are case-sensitive.
*
* @method Phaser.GameObjects.DOMElement#getChildByName
* @since 3.17.0
- *
+ *
* @param {string} name - The name to search the children for.
- *
+ *
* @return {?Element} The first matching child DOM Element, or `null` if not found.
*/
getChildByName: function (name)
@@ -81369,9 +84313,9 @@ var DOMElement = new Class({
*
* @method Phaser.GameObjects.DOMElement#setClassName
* @since 3.17.0
- *
+ *
* @param {string} className - A string representing the class or space-separated classes of the element.
- *
+ *
* @return {this} This DOM Element instance.
*/
setClassName: function (className)
@@ -81388,14 +84332,14 @@ var DOMElement = new Class({
/**
* Sets the `innerText` property of the DOM Element node and updates the internal sizes.
- *
+ *
* Note that only certain types of Elements can have `innerText` set on them.
*
* @method Phaser.GameObjects.DOMElement#setText
* @since 3.17.0
- *
+ *
* @param {string} text - A DOMString representing the rendered text content of the element.
- *
+ *
* @return {this} This DOM Element instance.
*/
setText: function (text)
@@ -81415,9 +84359,9 @@ var DOMElement = new Class({
*
* @method Phaser.GameObjects.DOMElement#setHTML
* @since 3.17.0
- *
+ *
* @param {string} html - A DOMString of html to be set as the `innerHTML` property of the element.
- *
+ *
* @return {this} This DOM Element instance.
*/
setHTML: function (html)
@@ -81452,7 +84396,7 @@ var DOMElement = new Class({
/**
* Compares the renderMask with the renderFlags to see if this Game Object will render or not.
- *
+ *
* DOMElements always return `true` as they need to still set values during the render pass, even if not visible.
*
* @method Phaser.GameObjects.DOMElement#willRender
@@ -81486,7 +84430,7 @@ module.exports = DOMElement;
/***/ }),
-/* 388 */
+/* 396 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -81495,7 +84439,7 @@ module.exports = DOMElement;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CSSBlendModes = __webpack_require__(951);
+var CSSBlendModes = __webpack_require__(962);
var GameObject = __webpack_require__(14);
/**
@@ -81608,7 +84552,7 @@ module.exports = DOMElementCSSRenderer;
/***/ }),
-/* 389 */
+/* 397 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -81620,7 +84564,7 @@ module.exports = DOMElementCSSRenderer;
var Class = __webpack_require__(0);
var Components = __webpack_require__(12);
var GameObject = __webpack_require__(14);
-var ExternRender = __webpack_require__(955);
+var ExternRender = __webpack_require__(966);
/**
* @classdesc
@@ -81704,7 +84648,7 @@ module.exports = Extern;
/***/ }),
-/* 390 */
+/* 398 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -81713,7 +84657,7 @@ module.exports = Extern;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CircumferencePoint = __webpack_require__(191);
+var CircumferencePoint = __webpack_require__(199);
var FromPercent = __webpack_require__(87);
var MATH_CONST = __webpack_require__(13);
var Point = __webpack_require__(4);
@@ -81747,7 +84691,7 @@ module.exports = GetPoint;
/***/ }),
-/* 391 */
+/* 399 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -81756,8 +84700,8 @@ module.exports = GetPoint;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Circumference = __webpack_require__(392);
-var CircumferencePoint = __webpack_require__(191);
+var Circumference = __webpack_require__(400);
+var CircumferencePoint = __webpack_require__(199);
var FromPercent = __webpack_require__(87);
var MATH_CONST = __webpack_require__(13);
@@ -81782,7 +84726,7 @@ var GetPoints = function (ellipse, quantity, stepRate, out)
if (out === undefined) { out = []; }
// If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
- if (!quantity)
+ if (!quantity && stepRate > 0)
{
quantity = Circumference(ellipse) / stepRate;
}
@@ -81801,7 +84745,7 @@ module.exports = GetPoints;
/***/ }),
-/* 392 */
+/* 400 */
/***/ (function(module, exports) {
/**
@@ -81833,7 +84777,7 @@ module.exports = Circumference;
/***/ }),
-/* 393 */
+/* 401 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -81842,8 +84786,8 @@ module.exports = Circumference;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Commands = __webpack_require__(190);
-var SetTransform = __webpack_require__(27);
+var Commands = __webpack_require__(198);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -82083,7 +85027,7 @@ module.exports = GraphicsCanvasRenderer;
/***/ }),
-/* 394 */
+/* 402 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -82302,7 +85246,7 @@ module.exports = GravityWell;
/***/ }),
-/* 395 */
+/* 403 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -82312,8 +85256,8 @@ module.exports = GravityWell;
*/
var Class = __webpack_require__(0);
-var DegToRad = __webpack_require__(35);
-var DistanceBetween = __webpack_require__(53);
+var DegToRad = __webpack_require__(39);
+var DistanceBetween = __webpack_require__(54);
/**
* @classdesc
@@ -82871,7 +85815,7 @@ module.exports = Particle;
/***/ }),
-/* 396 */
+/* 404 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -82880,20 +85824,20 @@ module.exports = Particle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BlendModes = __webpack_require__(52);
+var BlendModes = __webpack_require__(53);
var Class = __webpack_require__(0);
var Components = __webpack_require__(12);
-var DeathZone = __webpack_require__(397);
-var EdgeZone = __webpack_require__(398);
-var EmitterOp = __webpack_require__(967);
+var DeathZone = __webpack_require__(405);
+var EdgeZone = __webpack_require__(406);
+var EmitterOp = __webpack_require__(978);
var GetFastValue = __webpack_require__(2);
-var GetRandom = __webpack_require__(183);
-var HasAny = __webpack_require__(399);
-var HasValue = __webpack_require__(99);
-var Particle = __webpack_require__(395);
-var RandomZone = __webpack_require__(400);
-var Rectangle = __webpack_require__(11);
-var StableSort = __webpack_require__(128);
+var GetRandom = __webpack_require__(191);
+var HasAny = __webpack_require__(407);
+var HasValue = __webpack_require__(109);
+var Particle = __webpack_require__(403);
+var RandomZone = __webpack_require__(408);
+var Rectangle = __webpack_require__(9);
+var StableSort = __webpack_require__(133);
var Vector2 = __webpack_require__(3);
var Wrap = __webpack_require__(58);
@@ -83646,7 +86590,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} config - Settings for this emitter.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
fromJSON: function (config)
{
@@ -83803,7 +86747,7 @@ var ParticleEmitter = new Class({
* @param {number} [offsetY=0] - Vertical offset of the particle origin from the Game Object.
* @param {boolean} [trackVisible=false] - Whether the emitter's visible state will track the target's visible state.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
startFollow: function (target, offsetX, offsetY, trackVisible)
{
@@ -83824,7 +86768,7 @@ var ParticleEmitter = new Class({
* @method Phaser.GameObjects.Particles.ParticleEmitter#stopFollow
* @since 3.0.0
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
stopFollow: function ()
{
@@ -83885,7 +86829,7 @@ var ParticleEmitter = new Class({
* @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.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setFrame: function (frames, pickRandom, quantity)
{
@@ -83940,7 +86884,7 @@ var ParticleEmitter = new Class({
*
* @param {boolean} [value=true] - Radial mode (true) or point mode (true).
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setRadial: function (value)
{
@@ -83961,7 +86905,7 @@ var ParticleEmitter = new Class({
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} x - The x-coordinate of the particle origin.
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} y - The y-coordinate of the particle origin.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setPosition: function (x, y)
{
@@ -83984,7 +86928,7 @@ var ParticleEmitter = new Class({
* @param {number} width - The width of the boundary.
* @param {number} height - The height of the boundary.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setBounds: function (x, y, width, height)
{
@@ -84019,7 +86963,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The speed, in pixels per second.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setSpeedX: function (value)
{
@@ -84040,7 +86984,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The speed, in pixels per second.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setSpeedY: function (value)
{
@@ -84064,7 +87008,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The speed, in pixels per second.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setSpeed: function (value)
{
@@ -84085,7 +87029,7 @@ var ParticleEmitter = new Class({
*
* @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - The scale, relative to 1.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setScaleX: function (value)
{
@@ -84102,7 +87046,7 @@ var ParticleEmitter = new Class({
*
* @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - The scale, relative to 1.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setScaleY: function (value)
{
@@ -84119,7 +87063,7 @@ var ParticleEmitter = new Class({
*
* @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - The scale, relative to 1.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setScale: function (value)
{
@@ -84137,7 +87081,7 @@ var ParticleEmitter = new Class({
*
* @param {number} value - Acceleration due to gravity, in pixels per second squared.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setGravityX: function (value)
{
@@ -84154,7 +87098,7 @@ var ParticleEmitter = new Class({
*
* @param {number} value - Acceleration due to gravity, in pixels per second squared.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setGravityY: function (value)
{
@@ -84172,7 +87116,7 @@ var ParticleEmitter = new Class({
* @param {number} x - Horizontal acceleration due to gravity, in pixels per second squared.
* @param {number} y - Vertical acceleration due to gravity, in pixels per second squared.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setGravity: function (x, y)
{
@@ -84190,7 +87134,7 @@ var ParticleEmitter = new Class({
*
* @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - A value between 0 (transparent) and 1 (opaque).
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setAlpha: function (value)
{
@@ -84207,7 +87151,7 @@ var ParticleEmitter = new Class({
*
* @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - A value between 0 and 0xffffff.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setTint: function (value)
{
@@ -84224,7 +87168,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The angle of the initial velocity of emitted particles.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setEmitterAngle: function (value)
{
@@ -84241,7 +87185,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The angle of the initial velocity of emitted particles.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setAngle: function (value)
{
@@ -84258,7 +87202,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The particle lifespan, in ms.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setLifespan: function (value)
{
@@ -84275,7 +87219,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} quantity - The number of particles to release at each flow cycle or explosion.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setQuantity: function (quantity)
{
@@ -84294,7 +87238,7 @@ var ParticleEmitter = new Class({
* @param {number} frequency - The time interval (>= 0) of each flow cycle, in ms; or -1 to put the emitter in explosion mode.
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} [quantity] - The number of particles to release at each flow cycle or explosion.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setFrequency: function (frequency, quantity)
{
@@ -84322,7 +87266,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current emit zone.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setEmitZone: function (zoneConfig)
{
@@ -84371,7 +87315,7 @@ var ParticleEmitter = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.ParticleEmitterDeathZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current death zone.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
setDeathZone: function (zoneConfig)
{
@@ -84407,7 +87351,7 @@ var ParticleEmitter = new Class({
*
* @param {integer} particleCount - The number of particles to create.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
reserve: function (particleCount)
{
@@ -84482,7 +87426,7 @@ var ParticleEmitter = new Class({
* @param {Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} callback - The function.
* @param {*} [context] - The calling context.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
onParticleEmit: function (callback, context)
{
@@ -84514,7 +87458,7 @@ var ParticleEmitter = new Class({
* @param {Phaser.Types.GameObjects.Particles.ParticleDeathCallback} callback - The function.
* @param {*} [context] - The function's calling context.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
onParticleDeath: function (callback, context)
{
@@ -84543,7 +87487,7 @@ var ParticleEmitter = new Class({
* @method Phaser.GameObjects.Particles.ParticleEmitter#killAll
* @since 3.0.0
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
killAll: function ()
{
@@ -84567,7 +87511,7 @@ var ParticleEmitter = new Class({
* @param {Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} callback - The function.
* @param {*} context - The function's calling context.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
forEachAlive: function (callback, context)
{
@@ -84592,7 +87536,7 @@ var ParticleEmitter = new Class({
* @param {Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} callback - The function.
* @param {*} context - The function's calling context.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
forEachDead: function (callback, context)
{
@@ -84619,7 +87563,7 @@ var ParticleEmitter = new Class({
* @method Phaser.GameObjects.Particles.ParticleEmitter#start
* @since 3.0.0
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
start: function ()
{
@@ -84636,7 +87580,7 @@ var ParticleEmitter = new Class({
* @method Phaser.GameObjects.Particles.ParticleEmitter#stop
* @since 3.11.0
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
stop: function ()
{
@@ -84651,7 +87595,7 @@ var ParticleEmitter = new Class({
* @method Phaser.GameObjects.Particles.ParticleEmitter#pause
* @since 3.0.0
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
pause: function ()
{
@@ -84666,7 +87610,7 @@ var ParticleEmitter = new Class({
* @method Phaser.GameObjects.Particles.ParticleEmitter#resume
* @since 3.0.0
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
resume: function ()
{
@@ -84681,7 +87625,7 @@ var ParticleEmitter = new Class({
* @method Phaser.GameObjects.Particles.ParticleEmitter#remove
* @since 3.22.0
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
remove: function ()
{
@@ -84696,7 +87640,7 @@ var ParticleEmitter = new Class({
* @method Phaser.GameObjects.Particles.ParticleEmitter#depthSort
* @since 3.0.0
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
depthSort: function ()
{
@@ -84716,7 +87660,7 @@ var ParticleEmitter = new Class({
* @param {number} frequency - The time interval (>= 0) of each flow cycle, in ms.
* @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} [count=1] - The number of particles to emit at each flow cycle.
*
- * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
+ * @return {this} This Particle Emitter.
*/
flow: function (frequency, count)
{
@@ -84942,7 +87886,7 @@ module.exports = ParticleEmitter;
/***/ }),
-/* 397 */
+/* 405 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -85020,7 +87964,7 @@ module.exports = DeathZone;
/***/ }),
-/* 398 */
+/* 406 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -85156,7 +88100,7 @@ var EdgeZone = new Class({
* @method Phaser.GameObjects.Particles.Zones.EdgeZone#updateSource
* @since 3.0.0
*
- * @return {Phaser.GameObjects.Particles.Zones.EdgeZone} This Edge Zone.
+ * @return {this} This Edge Zone.
*/
updateSource: function ()
{
@@ -85195,7 +88139,7 @@ var EdgeZone = new Class({
*
* @param {Phaser.Types.GameObjects.Particles.EdgeZoneSource} source - An object instance with a `getPoints(quantity, stepRate)` method returning an array of points.
*
- * @return {Phaser.GameObjects.Particles.Zones.EdgeZone} This Edge Zone.
+ * @return {this} This Edge Zone.
*/
changeSource: function (source)
{
@@ -85264,7 +88208,7 @@ module.exports = EdgeZone;
/***/ }),
-/* 399 */
+/* 407 */
/***/ (function(module, exports) {
/**
@@ -85301,7 +88245,7 @@ module.exports = HasAny;
/***/ }),
-/* 400 */
+/* 408 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -85374,7 +88318,7 @@ module.exports = RandomZone;
/***/ }),
-/* 401 */
+/* 409 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -85385,7 +88329,7 @@ module.exports = RandomZone;
var Class = __webpack_require__(0);
var Components = __webpack_require__(12);
-var Sprite = __webpack_require__(69);
+var Sprite = __webpack_require__(75);
/**
* @classdesc
@@ -85405,14 +88349,14 @@ var Sprite = __webpack_require__(69);
* @memberof Phaser.GameObjects
* @constructor
* @since 3.0.0
- *
+ *
* @extends Phaser.GameObjects.Components.PathFollower
*
* @param {Phaser.Scene} scene - The Scene to which this PathFollower belongs.
* @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path 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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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 PathFollower = new Class({
@@ -85456,7 +88400,7 @@ module.exports = PathFollower;
/***/ }),
-/* 402 */
+/* 410 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -85465,13 +88409,13 @@ module.exports = PathFollower;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ArcRender = __webpack_require__(990);
+var ArcRender = __webpack_require__(1004);
var Class = __webpack_require__(0);
-var DegToRad = __webpack_require__(35);
+var DegToRad = __webpack_require__(39);
var Earcut = __webpack_require__(66);
var GeomCircle = __webpack_require__(65);
var MATH_CONST = __webpack_require__(13);
-var Shape = __webpack_require__(30);
+var Shape = __webpack_require__(29);
/**
* @classdesc
@@ -85865,7 +88809,7 @@ module.exports = Arc;
/***/ }),
-/* 403 */
+/* 411 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -85875,10 +88819,10 @@ module.exports = Arc;
*/
var Class = __webpack_require__(0);
-var CurveRender = __webpack_require__(993);
+var CurveRender = __webpack_require__(1007);
var Earcut = __webpack_require__(66);
-var Rectangle = __webpack_require__(11);
-var Shape = __webpack_require__(30);
+var Rectangle = __webpack_require__(9);
+var Shape = __webpack_require__(29);
/**
* @classdesc
@@ -86047,7 +88991,7 @@ module.exports = Curve;
/***/ }),
-/* 404 */
+/* 412 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -86058,9 +89002,9 @@ module.exports = Curve;
var Class = __webpack_require__(0);
var Earcut = __webpack_require__(66);
-var EllipseRender = __webpack_require__(996);
-var GeomEllipse = __webpack_require__(95);
-var Shape = __webpack_require__(30);
+var EllipseRender = __webpack_require__(1010);
+var GeomEllipse = __webpack_require__(96);
+var Shape = __webpack_require__(29);
/**
* @classdesc
@@ -86234,7 +89178,7 @@ module.exports = Ellipse;
/***/ }),
-/* 405 */
+/* 413 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -86244,8 +89188,8 @@ module.exports = Ellipse;
*/
var Class = __webpack_require__(0);
-var Shape = __webpack_require__(30);
-var GridRender = __webpack_require__(999);
+var Shape = __webpack_require__(29);
+var GridRender = __webpack_require__(1013);
/**
* @classdesc
@@ -86516,7 +89460,7 @@ module.exports = Grid;
/***/ }),
-/* 406 */
+/* 414 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -86525,9 +89469,9 @@ module.exports = Grid;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var IsoBoxRender = __webpack_require__(1002);
+var IsoBoxRender = __webpack_require__(1016);
var Class = __webpack_require__(0);
-var Shape = __webpack_require__(30);
+var Shape = __webpack_require__(29);
/**
* @classdesc
@@ -86731,7 +89675,7 @@ module.exports = IsoBox;
/***/ }),
-/* 407 */
+/* 415 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -86741,8 +89685,8 @@ module.exports = IsoBox;
*/
var Class = __webpack_require__(0);
-var IsoTriangleRender = __webpack_require__(1005);
-var Shape = __webpack_require__(30);
+var IsoTriangleRender = __webpack_require__(1019);
+var Shape = __webpack_require__(29);
/**
* @classdesc
@@ -86977,7 +89921,7 @@ module.exports = IsoTriangle;
/***/ }),
-/* 408 */
+/* 416 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -86987,9 +89931,9 @@ module.exports = IsoTriangle;
*/
var Class = __webpack_require__(0);
-var Shape = __webpack_require__(30);
-var GeomLine = __webpack_require__(56);
-var LineRender = __webpack_require__(1008);
+var Shape = __webpack_require__(29);
+var GeomLine = __webpack_require__(49);
+var LineRender = __webpack_require__(1022);
/**
* @classdesc
@@ -87144,7 +90088,7 @@ module.exports = Line;
/***/ }),
-/* 409 */
+/* 417 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -87153,13 +90097,13 @@ module.exports = Line;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PolygonRender = __webpack_require__(1011);
+var PolygonRender = __webpack_require__(1025);
var Class = __webpack_require__(0);
var Earcut = __webpack_require__(66);
-var GetAABB = __webpack_require__(410);
-var GeomPolygon = __webpack_require__(198);
-var Shape = __webpack_require__(30);
-var Smooth = __webpack_require__(413);
+var GetAABB = __webpack_require__(418);
+var GeomPolygon = __webpack_require__(207);
+var Shape = __webpack_require__(29);
+var Smooth = __webpack_require__(421);
/**
* @classdesc
@@ -87283,7 +90227,7 @@ module.exports = Polygon;
/***/ }),
-/* 410 */
+/* 418 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -87292,7 +90236,7 @@ module.exports = Polygon;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Rectangle = __webpack_require__(11);
+var Rectangle = __webpack_require__(9);
/**
* Calculates the bounding AABB rectangle of a polygon.
@@ -87339,7 +90283,7 @@ module.exports = GetAABB;
/***/ }),
-/* 411 */
+/* 419 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -87349,8 +90293,8 @@ module.exports = GetAABB;
*/
var Length = __webpack_require__(57);
-var Line = __webpack_require__(56);
-var Perimeter = __webpack_require__(412);
+var Line = __webpack_require__(49);
+var Perimeter = __webpack_require__(420);
/**
* Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon,
@@ -87374,7 +90318,7 @@ var GetPoints = function (polygon, quantity, stepRate, out)
var perimeter = Perimeter(polygon);
// If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
- if (!quantity)
+ if (!quantity && stepRate > 0)
{
quantity = perimeter / stepRate;
}
@@ -87416,7 +90360,7 @@ module.exports = GetPoints;
/***/ }),
-/* 412 */
+/* 420 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -87426,7 +90370,7 @@ module.exports = GetPoints;
*/
var Length = __webpack_require__(57);
-var Line = __webpack_require__(56);
+var Line = __webpack_require__(49);
/**
* Returns the perimeter of the given Polygon.
@@ -87464,7 +90408,7 @@ module.exports = Perimeter;
/***/ }),
-/* 413 */
+/* 421 */
/***/ (function(module, exports) {
/**
@@ -87540,7 +90484,7 @@ module.exports = Smooth;
/***/ }),
-/* 414 */
+/* 422 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -87550,9 +90494,9 @@ module.exports = Smooth;
*/
var Class = __webpack_require__(0);
-var GeomRectangle = __webpack_require__(11);
-var Shape = __webpack_require__(30);
-var RectangleRender = __webpack_require__(1014);
+var GeomRectangle = __webpack_require__(9);
+var Shape = __webpack_require__(29);
+var RectangleRender = __webpack_require__(1028);
/**
* @classdesc
@@ -87560,9 +90504,9 @@ var RectangleRender = __webpack_require__(1014);
* 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 both fill and stroke colors.
- *
+ *
* You can change the size of the rectangle by changing the `width` and `height` properties.
*
* @class Rectangle
@@ -87610,6 +90554,37 @@ var Rectangle = new Class({
this.updateData();
},
+ /**
+ * 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.Rectangle#setSize
+ * @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;
+
+ this.geom.setSize(width, height);
+
+ this.updateData();
+
+ return this;
+ },
+
/**
* Internal method that updates the data and path values.
*
@@ -87652,7 +90627,7 @@ module.exports = Rectangle;
/***/ }),
-/* 415 */
+/* 423 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -87661,10 +90636,10 @@ module.exports = Rectangle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var StarRender = __webpack_require__(1017);
+var StarRender = __webpack_require__(1031);
var Class = __webpack_require__(0);
var Earcut = __webpack_require__(66);
-var Shape = __webpack_require__(30);
+var Shape = __webpack_require__(29);
/**
* @classdesc
@@ -87940,7 +90915,7 @@ module.exports = Star;
/***/ }),
-/* 416 */
+/* 424 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -87950,9 +90925,9 @@ module.exports = Star;
*/
var Class = __webpack_require__(0);
-var Shape = __webpack_require__(30);
+var Shape = __webpack_require__(29);
var GeomTriangle = __webpack_require__(71);
-var TriangleRender = __webpack_require__(1020);
+var TriangleRender = __webpack_require__(1034);
/**
* @classdesc
@@ -88083,7 +91058,7 @@ module.exports = Triangle;
/***/ }),
-/* 417 */
+/* 425 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -88170,7 +91145,7 @@ module.exports = GetPoint;
/***/ }),
-/* 418 */
+/* 426 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -88212,7 +91187,7 @@ var GetPoints = function (triangle, quantity, stepRate, out)
var perimeter = length1 + length2 + length3;
// If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
- if (!quantity)
+ if (!quantity && stepRate > 0)
{
quantity = perimeter / stepRate;
}
@@ -88263,7 +91238,7 @@ module.exports = GetPoints;
/***/ }),
-/* 419 */
+/* 427 */
/***/ (function(module, exports) {
/**
@@ -88346,7 +91321,7 @@ module.exports = SetValue;
/***/ }),
-/* 420 */
+/* 428 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -88364,7 +91339,7 @@ var Utils = __webpack_require__(10);
*
* 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.
+ * 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.
*
@@ -88390,83 +91365,101 @@ var Light = new Class({
/**
* The horizontal position of the light.
*
- * @name Phaser.GameObjects.Light#x
+ * @name Phaser.GameObjects.Light#_x
* @type {number}
+ * @private
* @since 3.0.0
*/
- this.x = x;
+ this._x = x;
/**
* The vertical position of the light.
*
- * @name Phaser.GameObjects.Light#y
+ * @name Phaser.GameObjects.Light#_y
* @type {number}
+ * @private
* @since 3.0.0
*/
- this.y = y;
+ this._y = y;
/**
* The radius of the light.
*
- * @name Phaser.GameObjects.Light#radius
+ * @name Phaser.GameObjects.Light#_radius
* @type {number}
+ * @private
* @since 3.0.0
*/
- this.radius = radius;
+ this._radius = radius;
/**
* The red color of the light. A value between 0 and 1.
*
- * @name Phaser.GameObjects.Light#r
+ * @name Phaser.GameObjects.Light#_r
* @type {number}
+ * @private
* @since 3.0.0
*/
- this.r = r;
+ this._r = r;
/**
* The green color of the light. A value between 0 and 1.
*
- * @name Phaser.GameObjects.Light#g
+ * @name Phaser.GameObjects.Light#_g
* @type {number}
+ * @private
* @since 3.0.0
*/
- this.g = g;
+ this._g = g;
/**
* The blue color of the light. A value between 0 and 1.
*
- * @name Phaser.GameObjects.Light#b
+ * @name Phaser.GameObjects.Light#_b
* @type {number}
+ * @private
* @since 3.0.0
*/
- this.b = b;
+ this._b = 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;
+ this._intensity = intensity;
/**
* The horizontal scroll factor of the light.
*
- * @name Phaser.GameObjects.Light#scrollFactorX
+ * @name Phaser.GameObjects.Light#_scrollFactorX
* @type {number}
+ * @private
* @since 3.0.0
*/
- this.scrollFactorX = 1.0;
+ this._scrollFactorX = 1;
/**
* The vertical scroll factor of the light.
*
- * @name Phaser.GameObjects.Light#scrollFactorY
+ * @name Phaser.GameObjects.Light#_scrollFactorY
* @type {number}
+ * @private
* @since 3.0.0
*/
- this.scrollFactorY = 1.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;
},
/**
@@ -88486,23 +91479,25 @@ var Light = new Class({
* @param {number} b - The blue color. A value between 0 and 1.
* @param {number} intensity - The intensity of the light.
*
- * @return {Phaser.GameObjects.Light} This Light object.
+ * @return {this} This Light object.
*/
set: function (x, y, radius, r, g, b, intensity)
{
- this.x = x;
- this.y = y;
+ this._x = x;
+ this._y = y;
- this.radius = radius;
+ this._radius = radius;
- this.r = r;
- this.g = g;
- this.b = b;
+ this._r = r;
+ this._g = g;
+ this._b = b;
- this.intensity = intensity;
+ this._intensity = intensity;
- this.scrollFactorX = 1;
- this.scrollFactorY = 1;
+ this._scrollFactorX = 1;
+ this._scrollFactorY = 1;
+
+ this.dirty = true;
return this;
},
@@ -88513,18 +91508,20 @@ var Light = new Class({
* @method Phaser.GameObjects.Light#setScrollFactor
* @since 3.0.0
*
- * @param {number} x - The horizontal scroll factor of the light.
- * @param {number} y - The vertical scroll factor of the light.
+ * @param {number} [x=1] - The horizontal scroll factor of the light.
+ * @param {number} [y=x] - The vertical scroll factor of the light.
*
- * @return {Phaser.GameObjects.Light} This Light object.
+ * @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._scrollFactorX = x;
+ this._scrollFactorY = y;
+
+ this.dirty = true;
return this;
},
@@ -88537,15 +91534,17 @@ var Light = new Class({
*
* @param {number} rgb - The integer RGB color of the light.
*
- * @return {Phaser.GameObjects.Light} This Light object.
+ * @return {this} This Light object.
*/
setColor: function (rgb)
{
var color = Utils.getFloatsFromUintRGB(rgb);
- this.r = color[0];
- this.g = color[1];
- this.b = color[2];
+ this._r = color[0];
+ this._g = color[1];
+ this._b = color[2];
+
+ this.dirty = true;
return this;
},
@@ -88558,11 +91557,13 @@ var Light = new Class({
*
* @param {number} intensity - The intensity of the light.
*
- * @return {Phaser.GameObjects.Light} This Light object.
+ * @return {this} This Light object.
*/
setIntensity: function (intensity)
{
- this.intensity = intensity;
+ this._intensity = intensity;
+
+ this.dirty = true;
return this;
},
@@ -88576,12 +91577,14 @@ var Light = new Class({
* @param {number} x - The horizontal position of the light.
* @param {number} y - The vertical position of the light.
*
- * @return {Phaser.GameObjects.Light} This Light object.
+ * @return {this} This Light object.
*/
setPosition: function (x, y)
{
- this.x = x;
- this.y = y;
+ this._x = x;
+ this._y = y;
+
+ this.dirty = true;
return this;
},
@@ -88594,13 +91597,213 @@ var Light = new Class({
*
* @param {number} radius - The radius of the light.
*
- * @return {Phaser.GameObjects.Light} This Light object.
+ * @return {this} This Light object.
*/
setRadius: function (radius)
{
- this.radius = radius;
+ this._radius = radius;
+
+ this.dirty = true;
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;
+ }
+
}
});
@@ -88609,7 +91812,7 @@ module.exports = Light;
/***/ }),
-/* 421 */
+/* 429 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -88619,7 +91822,7 @@ module.exports = Light;
*/
var Class = __webpack_require__(0);
-var Light = __webpack_require__(420);
+var Light = __webpack_require__(428);
var Utils = __webpack_require__(10);
/**
@@ -88767,13 +91970,13 @@ var LightsManager = new Class({
var cameraRadius = (camera.width + camera.height) / 2.0;
var point = { x: 0, y: 0 };
var cameraMatrix = camera.matrix;
- var viewportHeight = this.systems.game.config.height;
+ var viewportHeight = this.systems.game.renderer.height;
culledLights.length = 0;
- for (var index = 0; index < length && culledLights.length < this.maxLights; index++)
+ for (var i = 0; i < length && culledLights.length < this.maxLights; i++)
{
- var light = lights[index];
+ var light = lights[i];
cameraMatrix.transformPoint(light.x, light.y, point);
@@ -88784,7 +91987,7 @@ var LightsManager = new Class({
if (distance < light.radius + cameraRadius)
{
- culledLights.push(lights[index]);
+ culledLights.push(lights[i]);
}
}
@@ -88811,9 +92014,9 @@ var LightsManager = new Class({
var lights = this.lights;
var length = lights.length;
- for (var index = 0; index < length; ++index)
+ for (var i = 0; i < length; i++)
{
- callback(lights[index]);
+ callback(lights[i]);
}
return this;
@@ -88882,21 +92085,25 @@ var LightsManager = new Class({
*/
addLight: function (x, y, radius, rgb, intensity)
{
+ if (x === undefined) { x = 0; }
+ if (y === undefined) { y = 0; }
+ if (radius === undefined) { radius = 100; }
+ if (rgb === undefined) { rgb = 0xffffff; }
+ if (intensity === undefined) { intensity = 1; }
+
var color = null;
var light = null;
- x = (x === undefined) ? 0.0 : x;
- y = (y === undefined) ? 0.0 : y;
- rgb = (rgb === undefined) ? 0xffffff : rgb;
- radius = (radius === undefined) ? 100.0 : radius;
- intensity = (intensity === undefined) ? 1.0 : intensity;
-
color = Utils.getFloatsFromUintRGB(rgb);
+
light = null;
- if (this.lightPool.length > 0)
+ var pool = this.lightPool;
+
+ if (pool.length > 0)
{
- light = this.lightPool.pop();
+ light = pool.pop();
+
light.set(x, y, radius, color[0], color[1], color[2], intensity);
}
else
@@ -88964,6 +92171,8 @@ var LightsManager = new Class({
destroy: function ()
{
this.shutdown();
+
+ this.lightPool.length = 0;
}
});
@@ -88972,7 +92181,7 @@ module.exports = LightsManager;
/***/ }),
-/* 422 */
+/* 430 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -88981,8 +92190,8 @@ module.exports = LightsManager;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CONST = __webpack_require__(46);
-var Extend = __webpack_require__(17);
+var CONST = __webpack_require__(47);
+var Extend = __webpack_require__(19);
/**
* @namespace Phaser.Geom
@@ -88990,14 +92199,14 @@ var Extend = __webpack_require__(17);
var Geom = {
- Circle: __webpack_require__(1078),
- Ellipse: __webpack_require__(1088),
- Intersects: __webpack_require__(423),
- Line: __webpack_require__(1107),
- Point: __webpack_require__(1128),
- Polygon: __webpack_require__(1142),
- Rectangle: __webpack_require__(436),
- Triangle: __webpack_require__(1172)
+ Circle: __webpack_require__(1094),
+ Ellipse: __webpack_require__(1104),
+ Intersects: __webpack_require__(431),
+ Line: __webpack_require__(1124),
+ Point: __webpack_require__(1146),
+ Polygon: __webpack_require__(1160),
+ Rectangle: __webpack_require__(445),
+ Triangle: __webpack_require__(1192)
};
@@ -89008,7 +92217,7 @@ module.exports = Geom;
/***/ }),
-/* 423 */
+/* 431 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89023,35 +92232,106 @@ module.exports = Geom;
module.exports = {
- CircleToCircle: __webpack_require__(202),
- CircleToRectangle: __webpack_require__(203),
- GetCircleToCircle: __webpack_require__(1098),
- GetCircleToRectangle: __webpack_require__(1099),
- GetLineToCircle: __webpack_require__(204),
- GetLineToRectangle: __webpack_require__(206),
- GetRectangleIntersection: __webpack_require__(1100),
- GetRectangleToRectangle: __webpack_require__(1101),
- GetRectangleToTriangle: __webpack_require__(1102),
- GetTriangleToCircle: __webpack_require__(1103),
- GetTriangleToLine: __webpack_require__(428),
- GetTriangleToTriangle: __webpack_require__(1104),
- LineToCircle: __webpack_require__(205),
+ CircleToCircle: __webpack_require__(211),
+ CircleToRectangle: __webpack_require__(212),
+ GetCircleToCircle: __webpack_require__(1114),
+ GetCircleToRectangle: __webpack_require__(1115),
+ GetLineToCircle: __webpack_require__(213),
+ GetLineToLine: __webpack_require__(432),
+ GetLineToPolygon: __webpack_require__(1116),
+ GetLineToRectangle: __webpack_require__(215),
+ GetRectangleIntersection: __webpack_require__(1117),
+ GetRectangleToRectangle: __webpack_require__(1118),
+ GetRectangleToTriangle: __webpack_require__(1119),
+ GetTriangleToCircle: __webpack_require__(1120),
+ GetTriangleToLine: __webpack_require__(437),
+ GetTriangleToTriangle: __webpack_require__(1121),
+ LineToCircle: __webpack_require__(214),
LineToLine: __webpack_require__(84),
- LineToRectangle: __webpack_require__(424),
- PointToLine: __webpack_require__(432),
- PointToLineSegment: __webpack_require__(1105),
- RectangleToRectangle: __webpack_require__(131),
- RectangleToTriangle: __webpack_require__(425),
- RectangleToValues: __webpack_require__(1106),
- TriangleToCircle: __webpack_require__(427),
- TriangleToLine: __webpack_require__(429),
- TriangleToTriangle: __webpack_require__(430)
+ LineToRectangle: __webpack_require__(433),
+ PointToLine: __webpack_require__(441),
+ PointToLineSegment: __webpack_require__(1122),
+ RectangleToRectangle: __webpack_require__(137),
+ RectangleToTriangle: __webpack_require__(434),
+ RectangleToValues: __webpack_require__(1123),
+ TriangleToCircle: __webpack_require__(436),
+ TriangleToLine: __webpack_require__(438),
+ TriangleToTriangle: __webpack_require__(439)
};
/***/ }),
-/* 424 */
+/* 432 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+var Vector3 = __webpack_require__(94);
+
+/**
+ * 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.
+ *
+ * @function Phaser.Geom.Intersects.GetLineToLine
+ * @since 3.50.0
+ *
+ * @param {Phaser.Geom.Line} line1 - The first line segment to check.
+ * @param {Phaser.Geom.Line} line2 - The second line segment to check.
+ * @param {Phaser.Math.Vector3} [out] - A Vector3 to store the intersection results in.
+ *
+ * @return {Phaser.Math.Vector3} A Vector3 containing the intersection results, or `null`.
+ */
+var GetLineToLine = function (line1, line2, out)
+{
+ var dx1 = line1.x2 - line1.x1;
+ var dy1 = line1.y2 - line1.y1;
+
+ var dx2 = line2.x2 - line2.x1;
+ var dy2 = line2.y2 - line2.y1;
+
+ var mag1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);
+ var mag2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
+
+ // Parallel?
+ if (dx1 / mag1 === dx2 / mag2 && dy1 / mag1 === dy2 / mag2)
+ {
+ return null;
+ }
+
+ 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;
+
+ // Intersects?
+ if (T1 < 0 || T2 < 0 || T2 > 1)
+ {
+ return null;
+ }
+
+ if (out === undefined)
+ {
+ out = new Vector3();
+ }
+
+ return out.set(
+ line1.x1 + dx1 * T1,
+ line1.y1 + dy1 * T1,
+ T1
+ );
+};
+
+module.exports = GetLineToLine;
+
+
+/***/ }),
+/* 433 */
/***/ (function(module, exports) {
/**
@@ -89152,7 +92432,7 @@ module.exports = LineToRectangle;
/***/ }),
-/* 425 */
+/* 434 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89162,9 +92442,9 @@ module.exports = LineToRectangle;
*/
var LineToLine = __webpack_require__(84);
-var Contains = __webpack_require__(47);
-var ContainsArray = __webpack_require__(207);
-var Decompose = __webpack_require__(426);
+var Contains = __webpack_require__(48);
+var ContainsArray = __webpack_require__(216);
+var Decompose = __webpack_require__(435);
/**
* Checks for intersection between Rectangle shape and Triangle shape.
@@ -89245,7 +92525,7 @@ module.exports = RectangleToTriangle;
/***/ }),
-/* 426 */
+/* 435 */
/***/ (function(module, exports) {
/**
@@ -89282,7 +92562,7 @@ module.exports = Decompose;
/***/ }),
-/* 427 */
+/* 436 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89291,7 +92571,7 @@ module.exports = Decompose;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var LineToCircle = __webpack_require__(205);
+var LineToCircle = __webpack_require__(214);
var Contains = __webpack_require__(83);
/**
@@ -89347,7 +92627,7 @@ module.exports = TriangleToCircle;
/***/ }),
-/* 428 */
+/* 437 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89358,7 +92638,7 @@ module.exports = TriangleToCircle;
*/
var Point = __webpack_require__(4);
-var TriangleToLine = __webpack_require__(429);
+var TriangleToLine = __webpack_require__(438);
var LineToLine = __webpack_require__(84);
/**
@@ -89406,7 +92686,7 @@ module.exports = GetTriangleToLine;
/***/ }),
-/* 429 */
+/* 438 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89462,7 +92742,7 @@ module.exports = TriangleToLine;
/***/ }),
-/* 430 */
+/* 439 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89471,8 +92751,8 @@ module.exports = TriangleToLine;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ContainsArray = __webpack_require__(207);
-var Decompose = __webpack_require__(431);
+var ContainsArray = __webpack_require__(216);
+var Decompose = __webpack_require__(440);
var LineToLine = __webpack_require__(84);
/**
@@ -89552,7 +92832,7 @@ module.exports = TriangleToTriangle;
/***/ }),
-/* 431 */
+/* 440 */
/***/ (function(module, exports) {
/**
@@ -89587,7 +92867,7 @@ module.exports = Decompose;
/***/ }),
-/* 432 */
+/* 441 */
/***/ (function(module, exports) {
/**
@@ -89657,7 +92937,7 @@ module.exports = PointToLine;
/***/ }),
-/* 433 */
+/* 442 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89691,7 +92971,7 @@ module.exports = NormalAngle;
/***/ }),
-/* 434 */
+/* 443 */
/***/ (function(module, exports) {
/**
@@ -89719,7 +92999,7 @@ module.exports = GetMagnitude;
/***/ }),
-/* 435 */
+/* 444 */
/***/ (function(module, exports) {
/**
@@ -89747,7 +93027,7 @@ module.exports = GetMagnitudeSq;
/***/ }),
-/* 436 */
+/* 445 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89756,51 +93036,52 @@ module.exports = GetMagnitudeSq;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Rectangle = __webpack_require__(11);
+var Rectangle = __webpack_require__(9);
-Rectangle.Area = __webpack_require__(1147);
-Rectangle.Ceil = __webpack_require__(1148);
-Rectangle.CeilAll = __webpack_require__(1149);
-Rectangle.CenterOn = __webpack_require__(165);
-Rectangle.Clone = __webpack_require__(1150);
-Rectangle.Contains = __webpack_require__(47);
-Rectangle.ContainsPoint = __webpack_require__(1151);
-Rectangle.ContainsRect = __webpack_require__(437);
-Rectangle.CopyFrom = __webpack_require__(1152);
-Rectangle.Decompose = __webpack_require__(426);
-Rectangle.Equals = __webpack_require__(1153);
-Rectangle.FitInside = __webpack_require__(1154);
-Rectangle.FitOutside = __webpack_require__(1155);
-Rectangle.Floor = __webpack_require__(1156);
-Rectangle.FloorAll = __webpack_require__(1157);
-Rectangle.FromPoints = __webpack_require__(174);
-Rectangle.GetAspectRatio = __webpack_require__(209);
-Rectangle.GetCenter = __webpack_require__(1158);
-Rectangle.GetPoint = __webpack_require__(149);
-Rectangle.GetPoints = __webpack_require__(271);
-Rectangle.GetSize = __webpack_require__(1159);
-Rectangle.Inflate = __webpack_require__(1160);
-Rectangle.Intersection = __webpack_require__(1161);
-Rectangle.MarchingAnts = __webpack_require__(282);
-Rectangle.MergePoints = __webpack_require__(1162);
-Rectangle.MergeRect = __webpack_require__(1163);
-Rectangle.MergeXY = __webpack_require__(1164);
-Rectangle.Offset = __webpack_require__(1165);
-Rectangle.OffsetPoint = __webpack_require__(1166);
-Rectangle.Overlaps = __webpack_require__(1167);
-Rectangle.Perimeter = __webpack_require__(112);
-Rectangle.PerimeterPoint = __webpack_require__(1168);
-Rectangle.Random = __webpack_require__(152);
-Rectangle.RandomOutside = __webpack_require__(1169);
-Rectangle.SameDimensions = __webpack_require__(1170);
-Rectangle.Scale = __webpack_require__(1171);
-Rectangle.Union = __webpack_require__(386);
+Rectangle.Area = __webpack_require__(1166);
+Rectangle.Ceil = __webpack_require__(1167);
+Rectangle.CeilAll = __webpack_require__(1168);
+Rectangle.CenterOn = __webpack_require__(173);
+Rectangle.Clone = __webpack_require__(1169);
+Rectangle.Contains = __webpack_require__(48);
+Rectangle.ContainsPoint = __webpack_require__(1170);
+Rectangle.ContainsRect = __webpack_require__(446);
+Rectangle.CopyFrom = __webpack_require__(1171);
+Rectangle.Decompose = __webpack_require__(435);
+Rectangle.Equals = __webpack_require__(1172);
+Rectangle.FitInside = __webpack_require__(1173);
+Rectangle.FitOutside = __webpack_require__(1174);
+Rectangle.Floor = __webpack_require__(1175);
+Rectangle.FloorAll = __webpack_require__(1176);
+Rectangle.FromPoints = __webpack_require__(182);
+Rectangle.FromXY = __webpack_require__(1177);
+Rectangle.GetAspectRatio = __webpack_require__(218);
+Rectangle.GetCenter = __webpack_require__(1178);
+Rectangle.GetPoint = __webpack_require__(156);
+Rectangle.GetPoints = __webpack_require__(278);
+Rectangle.GetSize = __webpack_require__(1179);
+Rectangle.Inflate = __webpack_require__(1180);
+Rectangle.Intersection = __webpack_require__(1181);
+Rectangle.MarchingAnts = __webpack_require__(289);
+Rectangle.MergePoints = __webpack_require__(1182);
+Rectangle.MergeRect = __webpack_require__(1183);
+Rectangle.MergeXY = __webpack_require__(1184);
+Rectangle.Offset = __webpack_require__(1185);
+Rectangle.OffsetPoint = __webpack_require__(1186);
+Rectangle.Overlaps = __webpack_require__(1187);
+Rectangle.Perimeter = __webpack_require__(113);
+Rectangle.PerimeterPoint = __webpack_require__(1188);
+Rectangle.Random = __webpack_require__(159);
+Rectangle.RandomOutside = __webpack_require__(1189);
+Rectangle.SameDimensions = __webpack_require__(1190);
+Rectangle.Scale = __webpack_require__(1191);
+Rectangle.Union = __webpack_require__(394);
module.exports = Rectangle;
/***/ }),
-/* 437 */
+/* 446 */
/***/ (function(module, exports) {
/**
@@ -89840,7 +93121,7 @@ module.exports = ContainsRect;
/***/ }),
-/* 438 */
+/* 447 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89884,7 +93165,7 @@ module.exports = Centroid;
/***/ }),
-/* 439 */
+/* 448 */
/***/ (function(module, exports) {
/**
@@ -89925,7 +93206,7 @@ module.exports = Offset;
/***/ }),
-/* 440 */
+/* 449 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -89990,7 +93271,7 @@ module.exports = InCenter;
/***/ }),
-/* 441 */
+/* 450 */
/***/ (function(module, exports) {
/**
@@ -90061,7 +93342,7 @@ module.exports = CreateInteractiveObject;
/***/ }),
-/* 442 */
+/* 451 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -90186,7 +93467,7 @@ module.exports = Axis;
/***/ }),
-/* 443 */
+/* 452 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -90196,7 +93477,7 @@ module.exports = Axis;
*/
var Class = __webpack_require__(0);
-var Events = __webpack_require__(211);
+var Events = __webpack_require__(220);
/**
* @classdesc
@@ -90332,7 +93613,7 @@ module.exports = Button;
/***/ }),
-/* 444 */
+/* 453 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -90341,10 +93622,10 @@ module.exports = Button;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Axis = __webpack_require__(442);
-var Button = __webpack_require__(443);
+var Axis = __webpack_require__(451);
+var Button = __webpack_require__(452);
var Class = __webpack_require__(0);
-var EventEmitter = __webpack_require__(9);
+var EventEmitter = __webpack_require__(11);
var Vector2 = __webpack_require__(3);
/**
@@ -91090,7 +94371,7 @@ module.exports = Gamepad;
/***/ }),
-/* 445 */
+/* 454 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -91100,8 +94381,8 @@ module.exports = Gamepad;
*/
var Class = __webpack_require__(0);
-var EventEmitter = __webpack_require__(9);
-var Events = __webpack_require__(133);
+var EventEmitter = __webpack_require__(11);
+var Events = __webpack_require__(139);
/**
* @classdesc
@@ -91332,7 +94613,7 @@ var Key = new Class({
*
* @param {boolean} value - Emit `down` events on repeated key down actions, or just once?
*
- * @return {Phaser.Input.Keyboard.Key} This Key instance.
+ * @return {this} This Key instance.
*/
setEmitOnRepeat: function (value)
{
@@ -91423,7 +94704,7 @@ var Key = new Class({
* @method Phaser.Input.Keyboard.Key#reset
* @since 3.6.0
*
- * @return {Phaser.Input.Keyboard.Key} This Key instance.
+ * @return {this} This Key instance.
*/
reset: function ()
{
@@ -91492,7 +94773,7 @@ module.exports = Key;
/***/ }),
-/* 446 */
+/* 455 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -91502,10 +94783,10 @@ module.exports = Key;
*/
var Class = __webpack_require__(0);
-var Events = __webpack_require__(133);
+var Events = __webpack_require__(139);
var GetFastValue = __webpack_require__(2);
-var ProcessKeyCombo = __webpack_require__(1211);
-var ResetKeyCombo = __webpack_require__(1213);
+var ProcessKeyCombo = __webpack_require__(1231);
+var ResetKeyCombo = __webpack_require__(1233);
/**
* @classdesc
@@ -91785,7 +95066,7 @@ module.exports = KeyCombo;
/***/ }),
-/* 447 */
+/* 456 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -91794,7 +95075,7 @@ module.exports = KeyCombo;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var MergeXHRSettings = __webpack_require__(212);
+var MergeXHRSettings = __webpack_require__(221);
/**
* Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings
@@ -91820,6 +95101,14 @@ var XHRLoader = function (file, globalXHRSettings)
xhr.responseType = file.xhrSettings.responseType;
xhr.timeout = config.timeout;
+ if (config.headers)
+ {
+ for (var key in config.headers)
+ {
+ xhr.setRequestHeader(key, config.headers[key]);
+ }
+ }
+
if (config.header && config.headerValue)
{
xhr.setRequestHeader(config.header, config.headerValue);
@@ -91835,6 +95124,11 @@ var XHRLoader = function (file, globalXHRSettings)
xhr.overrideMimeType(config.overrideMimeType);
}
+ if (config.withCredentials)
+ {
+ xhr.withCredentials = true;
+ }
+
// 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.)
xhr.onload = file.onLoad.bind(file, xhr);
@@ -91853,7 +95147,7 @@ module.exports = XHRLoader;
/***/ }),
-/* 448 */
+/* 457 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -91863,11 +95157,11 @@ module.exports = XHRLoader;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(29);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
-var HTML5AudioFile = __webpack_require__(449);
+var HTML5AudioFile = __webpack_require__(458);
var IsPlainObject = __webpack_require__(7);
/**
@@ -91875,7 +95169,7 @@ var IsPlainObject = __webpack_require__(7);
* A single Audio File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio.
*
* @class AudioFile
@@ -91946,7 +95240,7 @@ var AudioFile = new Class({
function (e)
{
// eslint-disable-next-line no-console
- console.error('Error decoding audio: ' + this.key + ' - ', e ? e.message : null);
+ console.error('Error decoding audio: ' + _this.key + ' - ', e ? e.message : null);
_this.onProcessError();
}
@@ -92003,7 +95297,10 @@ AudioFile.getAudioURL = function (game, urls)
if (url.indexOf('blob:') === 0 || url.indexOf('data:') === 0)
{
- return url;
+ return {
+ url: url,
+ type: ''
+ };
}
var audioType = url.match(/\.([a-zA-Z0-9]+)($|\?)/);
@@ -92026,7 +95323,7 @@ AudioFile.getAudioURL = function (game, urls)
* Adds an Audio or HTML5Audio file, or array of audio 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 ()
* {
@@ -92041,14 +95338,14 @@ AudioFile.getAudioURL = function (game, urls)
* 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 Audio Cache upon a successful load.
* The key should be unique both in terms of files being loaded and files already present in the Audio 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 Audio Cache first, before loading a new one.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.audio({
* key: 'title',
@@ -92070,7 +95367,7 @@ AudioFile.getAudioURL = function (game, urls)
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#audio
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig|Phaser.Types.Loader.FileTypes.AudioFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -92078,7 +95375,7 @@ AudioFile.getAudioURL = function (game, urls)
* @param {any} [config] - An object containing an `instances` property for HTML5Audio. Defaults to 1.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('audio', function (key, urls, config, xhrSettings)
{
@@ -92124,7 +95421,7 @@ module.exports = AudioFile;
/***/ }),
-/* 449 */
+/* 458 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -92134,10 +95431,10 @@ module.exports = AudioFile;
*/
var Class = __webpack_require__(0);
-var Events = __webpack_require__(81);
+var Events = __webpack_require__(82);
var File = __webpack_require__(21);
var GetFastValue = __webpack_require__(2);
-var GetURL = __webpack_require__(134);
+var GetURL = __webpack_require__(140);
var IsPlainObject = __webpack_require__(7);
/**
@@ -92277,7 +95574,12 @@ var HTML5AudioFile = new Class({
for (var i = 0; i < instances; i++)
{
var audio = new Audio();
- audio.dataset = {};
+
+ if (!audio.dataset)
+ {
+ audio.dataset = {};
+ }
+
audio.dataset.name = this.key + ('0' + i).slice(-2);
audio.dataset.used = 'false';
@@ -92322,7 +95624,7 @@ module.exports = HTML5AudioFile;
/***/ }),
-/* 450 */
+/* 459 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -92332,7 +95634,7 @@ module.exports = HTML5AudioFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -92343,7 +95645,7 @@ var IsPlainObject = __webpack_require__(7);
* A single Script File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#script method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#script.
*
* @class ScriptFile
@@ -92418,7 +95720,7 @@ var ScriptFile = new Class({
* Adds a Script file, or array of Script 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 ()
* {
@@ -92433,11 +95735,11 @@ var ScriptFile = new Class({
* 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 and not already in-use by another file in the Loader.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.script({
* key: 'aliens',
@@ -92462,14 +95764,14 @@ var ScriptFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#script
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig|Phaser.Types.Loader.FileTypes.ScriptFileConfig[])} 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 `.js`, i.e. if `key` was "alien" then the URL will be "alien.js".
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('script', function (key, url, xhrSettings)
{
@@ -92493,7 +95795,7 @@ module.exports = ScriptFile;
/***/ }),
-/* 451 */
+/* 460 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -92503,7 +95805,7 @@ module.exports = ScriptFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -92637,14 +95939,14 @@ var TextFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#text
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @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 {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('text', function (key, url, xhrSettings)
{
@@ -92668,7 +95970,7 @@ module.exports = TextFile;
/***/ }),
-/* 452 */
+/* 461 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -92677,12 +95979,12 @@ module.exports = TextFile;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ArcadeImage = __webpack_require__(453);
-var ArcadeSprite = __webpack_require__(136);
+var ArcadeImage = __webpack_require__(462);
+var ArcadeSprite = __webpack_require__(142);
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(50);
-var PhysicsGroup = __webpack_require__(454);
-var StaticPhysicsGroup = __webpack_require__(455);
+var CONST = __webpack_require__(51);
+var PhysicsGroup = __webpack_require__(463);
+var StaticPhysicsGroup = __webpack_require__(464);
/**
* @classdesc
@@ -92774,10 +96076,12 @@ var Factory = new Class({
* @method Phaser.Physics.Arcade.Factory#existing
* @since 3.0.0
*
+ * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
+ *
* @param {Phaser.GameObjects.GameObject} gameObject - A Game Object.
* @param {boolean} [isStatic=false] - Create a Static body (true) or Dynamic body (false).
*
- * @return {Phaser.GameObjects.GameObject} The Game Object.
+ * @return {Phaser.Types.Physics.Arcade.GameObjectWithBody} The Game Object.
*/
existing: function (gameObject, isStatic)
{
@@ -92796,10 +96100,10 @@ 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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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.Physics.Arcade.Image} The Image object that was created.
+ * @return {Phaser.Types.Physics.Arcade.ImageWithStaticBody} The Image object that was created.
*/
staticImage: function (x, y, key, frame)
{
@@ -92820,10 +96124,10 @@ 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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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.Physics.Arcade.Image} The Image object that was created.
+ * @return {Phaser.Types.Physics.Arcade.ImageWithDynamicBody} The Image object that was created.
*/
image: function (x, y, key, frame)
{
@@ -92844,10 +96148,10 @@ 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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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.Physics.Arcade.Sprite} The Sprite object that was created.
+ * @return {Phaser.Types.Physics.Arcade.SpriteWithStaticBody} The Sprite object that was created.
*/
staticSprite: function (x, y, key, frame)
{
@@ -92872,7 +96176,7 @@ var Factory = new Class({
* @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.
*
- * @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created.
+ * @return {Phaser.Types.Physics.Arcade.SpriteWithDynamicBody} The Sprite object that was created.
*/
sprite: function (x, y, key, frame)
{
@@ -92939,7 +96243,7 @@ module.exports = Factory;
/***/ }),
-/* 453 */
+/* 462 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -92949,8 +96253,8 @@ module.exports = Factory;
*/
var Class = __webpack_require__(0);
-var Components = __webpack_require__(214);
-var Image = __webpack_require__(98);
+var Components = __webpack_require__(223);
+var Image = __webpack_require__(108);
/**
* @classdesc
@@ -92994,7 +96298,7 @@ var Image = __webpack_require__(98);
* @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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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 ArcadeImage = new Class({
@@ -93039,7 +96343,7 @@ module.exports = ArcadeImage;
/***/ }),
-/* 454 */
+/* 463 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -93048,18 +96352,19 @@ module.exports = ArcadeImage;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ArcadeSprite = __webpack_require__(136);
+var ArcadeSprite = __webpack_require__(142);
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(50);
+var CONST = __webpack_require__(51);
var GetFastValue = __webpack_require__(2);
-var Group = __webpack_require__(97);
+var Group = __webpack_require__(98);
var IsPlainObject = __webpack_require__(7);
/**
* @classdesc
* An Arcade Physics Group object.
*
- * All Game Objects created by this Group will automatically be given dynamic Arcade Physics bodies.
+ * All Game Objects created by or added to this Group will automatically be given dynamic Arcade Physics bodies (if they have no body)
+ * and the bodies will receive the Group's {@link Phaser.Physics.Arcade.Group#defaults default values}.
*
* Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}.
*
@@ -93100,7 +96405,7 @@ var PhysicsGroup = new Class({
}
else if (Array.isArray(children) && IsPlainObject(children[0]))
{
- // children is an array of plain objects
+ // children is an array of plain objects (i.e., configs)
config = children[0];
var _this = this;
@@ -93110,6 +96415,8 @@ var PhysicsGroup = new Class({
singleConfig.internalCreateCallback = _this.createCallbackHandler;
singleConfig.internalRemoveCallback = _this.removeCallbackHandler;
});
+
+ children = null;
}
else
{
@@ -93154,6 +96461,8 @@ var PhysicsGroup = new Class({
/**
* 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 `{}`.
+ *
* @name Phaser.Physics.Arcade.Group#defaults
* @type {Phaser.Types.Physics.Arcade.PhysicsGroupDefaults}
* @since 3.0.0
@@ -93184,11 +96493,6 @@ var PhysicsGroup = new Class({
setImmovable: GetFastValue(config, 'immovable', false)
};
- if (Array.isArray(children))
- {
- config = null;
- }
-
Group.call(this, scene, children, config);
/**
@@ -93324,7 +96628,7 @@ module.exports = PhysicsGroup;
/***/ }),
-/* 455 */
+/* 464 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -93333,18 +96637,18 @@ module.exports = PhysicsGroup;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ArcadeSprite = __webpack_require__(136);
+var ArcadeSprite = __webpack_require__(142);
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(50);
+var CONST = __webpack_require__(51);
var GetFastValue = __webpack_require__(2);
-var Group = __webpack_require__(97);
+var Group = __webpack_require__(98);
var IsPlainObject = __webpack_require__(7);
/**
* @classdesc
* An Arcade Physics Static Group object.
*
- * All Game Objects created by this Group will automatically be given static Arcade Physics bodies.
+ * All Game Objects created by or added to this Group will automatically be given static Arcade Physics bodies, if they have no body.
*
* Its dynamic counterpart is {@link Phaser.Physics.Arcade.Group}.
*
@@ -93401,6 +96705,14 @@ var StaticPhysicsGroup = new Class({
singleConfig.classType = GetFastValue(singleConfig, 'classType', ArcadeSprite);
});
}
+ else
+ {
+ // config is not defined and children is not a plain object nor an array of plain objects
+ config = {
+ internalCreateCallback: this.createCallbackHandler,
+ internalRemoveCallback: this.removeCallbackHandler
+ };
+ }
/**
* The physics simulation.
@@ -93515,7 +96827,7 @@ module.exports = StaticPhysicsGroup;
/***/ }),
-/* 456 */
+/* 465 */
/***/ (function(module, exports) {
/**
@@ -93600,7 +96912,7 @@ module.exports = OverlapRect;
/***/ }),
-/* 457 */
+/* 466 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -93609,31 +96921,33 @@ module.exports = OverlapRect;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Body = __webpack_require__(458);
-var Clamp = __webpack_require__(22);
+var AngleBetweenPoints = __webpack_require__(322);
+var Body = __webpack_require__(467);
+var Clamp = __webpack_require__(17);
var Class = __webpack_require__(0);
-var Collider = __webpack_require__(459);
-var CONST = __webpack_require__(50);
-var DistanceBetween = __webpack_require__(53);
-var EventEmitter = __webpack_require__(9);
-var Events = __webpack_require__(215);
-var FuzzyEqual = __webpack_require__(144);
-var FuzzyGreaterThan = __webpack_require__(317);
-var FuzzyLessThan = __webpack_require__(318);
-var GetOverlapX = __webpack_require__(460);
-var GetOverlapY = __webpack_require__(461);
+var Collider = __webpack_require__(468);
+var CONST = __webpack_require__(51);
+var DistanceBetween = __webpack_require__(54);
+var EventEmitter = __webpack_require__(11);
+var Events = __webpack_require__(224);
+var FuzzyEqual = __webpack_require__(107);
+var FuzzyGreaterThan = __webpack_require__(326);
+var FuzzyLessThan = __webpack_require__(327);
+var GetOverlapX = __webpack_require__(469);
+var GetOverlapY = __webpack_require__(470);
var GetValue = __webpack_require__(6);
-var ProcessQueue = __webpack_require__(184);
-var ProcessTileCallbacks = __webpack_require__(1270);
-var Rectangle = __webpack_require__(11);
-var RTree = __webpack_require__(462);
-var SeparateTile = __webpack_require__(1271);
-var SeparateX = __webpack_require__(1276);
-var SeparateY = __webpack_require__(1277);
-var Set = __webpack_require__(108);
-var StaticBody = __webpack_require__(464);
-var TileIntersectsBody = __webpack_require__(463);
-var TransformMatrix = __webpack_require__(32);
+var MATH_CONST = __webpack_require__(13);
+var ProcessQueue = __webpack_require__(192);
+var ProcessTileCallbacks = __webpack_require__(1290);
+var Rectangle = __webpack_require__(9);
+var RTree = __webpack_require__(471);
+var SeparateTile = __webpack_require__(1291);
+var SeparateX = __webpack_require__(1296);
+var SeparateY = __webpack_require__(1297);
+var Set = __webpack_require__(135);
+var StaticBody = __webpack_require__(473);
+var TileIntersectsBody = __webpack_require__(472);
+var TransformMatrix = __webpack_require__(30);
var Vector2 = __webpack_require__(3);
var Wrap = __webpack_require__(58);
@@ -93759,6 +97073,17 @@ var World = new Class({
*/
this.fps = GetValue(config, 'fps', 60);
+ /**
+ * Should Physics use a fixed update time-step (true) or sync to the render fps (false)?.
+ * False value of this property disables fps and timeScale properties.
+ *
+ * @name Phaser.Physics.Arcade.World#fixedStep
+ * @type {boolean}
+ * @default true
+ * @since 3.23.0
+ */
+ this.fixedStep = true;
+
/**
* The amount of elapsed ms since the last frame.
*
@@ -93920,7 +97245,7 @@ var World = new Class({
this.maxEntries = GetValue(config, 'maxEntries', 16);
/**
- * Should this Arcade Physics World use an RTree for Dynamic and Static Physics bodies?
+ * Should this Arcade Physics World use an RTree for Dynamic bodies?
*
* An RTree is a fast way of spatially sorting of all the bodies in the world.
* However, at certain limits, the cost of clearing and inserting the bodies into the
@@ -94532,6 +97857,13 @@ var World = new Class({
// Will a step happen this frame?
var willStep = (this._elapsed >= msPerFrame);
+ if (!this.fixedStep)
+ {
+ fixedDelta = delta * 0.001;
+ willStep = true;
+ this._elapsed = 0;
+ }
+
for (i = 0; i < bodies.length; i++)
{
body = bodies[i];
@@ -94928,12 +98260,14 @@ var World = new Class({
* @param {ArcadePhysicsCallback} [processCallback] - The process callback.
* @param {*} [callbackContext] - The context in which to invoke the callback.
* @param {boolean} [overlapOnly] - If this a collide or overlap check?
+ * @param {boolean} [intersects] - Assert that the bodies intersect and should not be tested before separation.
*
* @return {boolean} True if separation occurred, otherwise false.
*/
- separate: function (body1, body2, processCallback, callbackContext, overlapOnly)
+ separate: function (body1, body2, processCallback, callbackContext, overlapOnly, intersects)
{
if (
+ !intersects &&
!body1.enable ||
!body2.enable ||
body1.checkCollision.none ||
@@ -94985,8 +98319,14 @@ var World = new Class({
var resultX = false;
var resultY = false;
- // Do we separate on x or y first?
- if (this.forceX || Math.abs(this.gravity.y + body1.gravity.y) < Math.abs(this.gravity.x + body1.gravity.x))
+ // Do we separate on x first or y first or both?
+ if (overlapOnly)
+ {
+ // No separation but we need to calculate overlapX, overlapY, etc.
+ resultX = SeparateX(body1, body2, overlapOnly, this.OVERLAP_BIAS);
+ resultY = SeparateY(body1, body2, overlapOnly, this.OVERLAP_BIAS);
+ }
+ else if (this.forceX || Math.abs(this.gravity.y + body1.gravity.y) < Math.abs(this.gravity.x + body1.gravity.x))
{
resultX = SeparateX(body1, body2, overlapOnly, this.OVERLAP_BIAS);
@@ -95044,6 +98384,9 @@ 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);
@@ -95114,39 +98457,48 @@ var World = new Class({
var ny = ((body2.center.y - body1.center.y) / d) || 0;
var p = 2 * (body1.velocity.x * nx + body1.velocity.y * ny - body2.velocity.x * nx - body2.velocity.y * ny) / (body1.mass + body2.mass);
+ if (body1.immovable || body2.immovable)
+ {
+ p *= 2;
+ }
+
if (!body1.immovable)
{
- body1.velocity.x = (body1.velocity.x - p * body1.mass * nx);
- body1.velocity.y = (body1.velocity.y - p * body1.mass * ny);
+ body1.velocity.x = (body1.velocity.x - p / body1.mass * nx);
+ body1.velocity.y = (body1.velocity.y - p / body1.mass * ny);
}
if (!body2.immovable)
{
- body2.velocity.x = (body2.velocity.x + p * body2.mass * nx);
- body2.velocity.y = (body2.velocity.y + p * body2.mass * ny);
+ body2.velocity.x = (body2.velocity.x + p / body2.mass * nx);
+ body2.velocity.y = (body2.velocity.y + p / body2.mass * ny);
}
- var dvx = body2.velocity.x - body1.velocity.x;
- var dvy = body2.velocity.y - body1.velocity.y;
- var angleCollision = Math.atan2(dvy, dvx);
-
- var delta = this._frameTime;
-
if (!body1.immovable && !body2.immovable)
{
overlap /= 2;
}
+ // TODO this is inadequate for circle-rectangle separation
+
+ var angle = AngleBetweenPoints(body1.center, body2.center);
+ var overlapX = (overlap + MATH_CONST.EPSILON) * Math.cos(angle);
+ var overlapY = (overlap + MATH_CONST.EPSILON) * Math.sin(angle);
+
if (!body1.immovable)
{
- body1.x += (body1.velocity.x * delta) - overlap * Math.cos(angleCollision);
- body1.y += (body1.velocity.y * delta) - overlap * Math.sin(angleCollision);
+ body1.x -= overlapX;
+ body1.y -= overlapY;
+
+ body1.updateCenter();
}
if (!body2.immovable)
{
- body2.x += (body2.velocity.x * delta) + overlap * Math.cos(angleCollision);
- body2.y += (body2.velocity.y * delta) + overlap * Math.sin(angleCollision);
+ body2.x += overlapX;
+ body2.y += overlapY;
+
+ body2.updateCenter();
}
body1.velocity.x *= body1.bounce.x;
@@ -95235,6 +98587,8 @@ var World = new Class({
/**
* Tests if Game Objects overlap.
*
+ * See details in {@link Phaser.Physics.Arcade.World#collide}.
+ *
* @method Phaser.Physics.Arcade.World#overlap
* @since 3.0.0
*
@@ -95245,6 +98599,8 @@ var World = new Class({
* @param {*} [callbackContext] - The context in which to run the callbacks.
*
* @return {boolean} True if at least one Game Object overlaps another.
+ *
+ * @see Phaser.Physics.Arcade.World#collide
*/
overlap: function (object1, object2, overlapCallback, processCallback, callbackContext)
{
@@ -95259,7 +98615,7 @@ var World = new Class({
* Performs a collision check and separation between the two physics enabled objects given, which can be single
* Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups.
*
- * If you don't require separation then use {@link #overlap} instead.
+ * If you don't require separation then use {@link Phaser.Physics.Arcade.World#overlap} instead.
*
* If two Groups or arrays are passed, each member of one will be tested against each member of the other.
*
@@ -95267,8 +98623,9 @@ var World = new Class({
*
* If **only** one Array is passed, the array is iterated and every element in it is tested against the others.
*
- * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding
- * objects are passed to it.
+ * Two callbacks can be provided; they receive the colliding game objects as arguments.
+ * If an overlap is detected, the `processCallback` is called first. It can cancel the collision by returning false.
+ * Next the objects are separated and `collideCallback` is invoked.
*
* Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable
* for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other.
@@ -95525,7 +98882,7 @@ var World = new Class({
{
var bodyA = sprite.body;
- if (group.length === 0 || !bodyA || !bodyA.enable)
+ if (group.length === 0 || !bodyA || !bodyA.enable || bodyA.checkCollision.none)
{
return;
}
@@ -95536,7 +98893,7 @@ var World = new Class({
var len;
var bodyB;
- if (this.useTree)
+ if (this.useTree || group.physicsType === CONST.STATIC_BODY)
{
var minMax = this.treeMinMax;
@@ -95553,13 +98910,13 @@ var World = new Class({
{
bodyB = results[i];
- if (bodyA === bodyB || !bodyB.enable || !group.contains(bodyB.gameObject))
+ if (bodyA === bodyB || !bodyB.enable || bodyB.checkCollision.none || !group.contains(bodyB.gameObject))
{
- // Skip if comparing against itself, or if bodyB isn't actually part of the Group
+ // Skip if comparing against itself, or if bodyB isn't collidable, or if bodyB isn't actually part of the Group
continue;
}
- if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly))
+ if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly, true))
{
if (collideCallback)
{
@@ -95738,7 +99095,7 @@ var World = new Class({
{
var body = sprite.body;
- if (!body.enable)
+ if (!body.enable || body.checkCollision.none)
{
return false;
}
@@ -95989,7 +99346,7 @@ module.exports = World;
/***/ }),
-/* 458 */
+/* 467 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -96000,11 +99357,11 @@ module.exports = World;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(50);
-var Events = __webpack_require__(215);
-var RadToDeg = __webpack_require__(171);
-var Rectangle = __webpack_require__(11);
-var RectangleContains = __webpack_require__(47);
+var CONST = __webpack_require__(51);
+var Events = __webpack_require__(224);
+var RadToDeg = __webpack_require__(178);
+var Rectangle = __webpack_require__(9);
+var RectangleContains = __webpack_require__(48);
var Vector2 = __webpack_require__(3);
/**
@@ -96027,8 +99384,8 @@ var Body = new Class({
function Body (world, gameObject)
{
- var width = (gameObject.width) ? gameObject.width : 64;
- var height = (gameObject.height) ? gameObject.height : 64;
+ var width = (gameObject.displayWidth) ? gameObject.displayWidth : 64;
+ var height = (gameObject.displayHeight) ? gameObject.displayHeight : 64;
/**
* The Arcade Physics simulation this Body belongs to.
@@ -96066,7 +99423,7 @@ var Body = new Class({
};
/**
- * Whether the Body's boundary is drawn to the debug display.
+ * Whether the Body is drawn to the debug display.
*
* @name Phaser.Physics.Arcade.Body#debugShowBody
* @type {boolean}
@@ -96103,7 +99460,7 @@ var Body = new Class({
this.enable = true;
/**
- * Whether this Body's boundary is circular (true) or rectangular (false).
+ * Whether this Body is circular (true) or rectangular (false).
*
* @name Phaser.Physics.Arcade.Body#isCircle
* @type {boolean}
@@ -96114,7 +99471,7 @@ var Body = new Class({
this.isCircle = false;
/**
- * If this Body is circular, this is the unscaled radius of the Body's boundary, as set by setCircle(), in source pixels.
+ * If this Body is circular, this is the unscaled radius of the Body, as set by setCircle(), in source pixels.
* The true radius is equal to `halfWidth`.
*
* @name Phaser.Physics.Arcade.Body#radius
@@ -96142,7 +99499,10 @@ var Body = new Class({
* @type {Phaser.Math.Vector2}
* @since 3.0.0
*/
- this.position = new Vector2(gameObject.x, gameObject.y);
+ this.position = new Vector2(
+ gameObject.x - gameObject.scaleX * gameObject.displayOriginX,
+ gameObject.y - gameObject.scaleY * gameObject.displayOriginY
+ );
/**
* The position of this Body during the previous step.
@@ -96151,16 +99511,16 @@ var Body = new Class({
* @type {Phaser.Math.Vector2}
* @since 3.0.0
*/
- this.prev = new Vector2(gameObject.x, gameObject.y);
+ this.prev = this.position.clone();
/**
* The position of this Body during the previous frame.
- *
+ *
* @name Phaser.Physics.Arcade.Body#prevFrame
* @type {Phaser.Math.Vector2}
* @since 3.20.0
*/
- this.prevFrame = new Vector2(gameObject.x, gameObject.y);
+ this.prevFrame = this.position.clone();
/**
* Whether this Body's `rotation` is affected by its angular acceleration and angular velocity.
@@ -96175,7 +99535,7 @@ var Body = new Class({
/**
* This body's rotation, in degrees, based on its angular acceleration and angular velocity.
* The Body's rotation controls the `angle` of its Game Object.
- * It doesn't rotate the Body's boundary, which is always an axis-aligned rectangle or a circle.
+ * It doesn't rotate the Body's own geometry, which is always an axis-aligned rectangle or a circle.
*
* @name Phaser.Physics.Arcade.Body#rotation
* @type {number}
@@ -96193,7 +99553,7 @@ var Body = new Class({
this.preRotation = gameObject.angle;
/**
- * The width of the Body boundary, in pixels.
+ * The width of the Body, in pixels.
* If the Body is circular, this is also the diameter.
* If you wish to change the width use the `Body.setSize` method.
*
@@ -96206,7 +99566,7 @@ var Body = new Class({
this.width = width;
/**
- * The height of the Body boundary, in pixels.
+ * The height of the Body, in pixels.
* If the Body is circular, this is also the diameter.
* If you wish to change the height use the `Body.setSize` method.
*
@@ -96265,14 +99625,14 @@ var Body = new Class({
this.halfHeight = Math.abs(height / 2);
/**
- * The center of the Body's boundary.
+ * The center of the Body.
* The midpoint of its `position` (top-left corner) and its bottom-right corner.
*
* @name Phaser.Physics.Arcade.Body#center
* @type {Phaser.Math.Vector2}
* @since 3.0.0
*/
- this.center = new Vector2(gameObject.x + this.halfWidth, gameObject.y + this.halfHeight);
+ this.center = new Vector2(this.position.x + this.halfWidth, this.position.y + this.halfHeight);
/**
* The Body's velocity, in pixels per second.
@@ -96324,18 +99684,19 @@ var Body = new Class({
this.allowDrag = true;
/**
- * Absolute loss of velocity due to movement, in pixels per second squared.
- * The x and y components are applied separately.
+ * 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.
* 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.
+ *
* Drag is applied only when `acceleration` is zero.
*
* @name Phaser.Physics.Arcade.Body#drag
- * @type {(Phaser.Math.Vector2|number)}
+ * @type {Phaser.Math.Vector2}
* @since 3.0.0
*/
this.drag = new Vector2();
@@ -96385,10 +99746,10 @@ var Body = new Class({
/**
* The rectangle used for world boundary collisions.
- *
+ *
* By default it is set to the world boundary rectangle. Or, if this Body was
* created by a Physics Group, then whatever rectangle that Group defined.
- *
+ *
* You can also change it by using the `Body.setBoundsRectangle` method.
*
* @name Phaser.Physics.Arcade.Body#customBoundsRectangle
@@ -96406,7 +99767,7 @@ var Body = new Class({
* @type {boolean}
* @default false
* @since 3.0.0
- * @see Phaser.Physics.Arcade.World#worldboundsEvent
+ * @see Phaser.Physics.Arcade.World#WORLD_BOUNDS
*/
this.onWorldBounds = false;
@@ -96417,7 +99778,7 @@ var Body = new Class({
* @type {boolean}
* @default false
* @since 3.0.0
- * @see Phaser.Physics.Arcade.World#collideEvent
+ * @see Phaser.Physics.Arcade.World#COLLIDE
*/
this.onCollide = false;
@@ -96428,7 +99789,7 @@ var Body = new Class({
* @type {boolean}
* @default false
* @since 3.0.0
- * @see Phaser.Physics.Arcade.World#overlapEvent
+ * @see Phaser.Physics.Arcade.World#OVERLAP
*/
this.onOverlap = false;
@@ -96561,11 +99922,17 @@ var Body = new Class({
/**
* The direction of the Body's velocity, as calculated during the last step.
- * If the Body is moving on both axes (diagonally), this describes motion on the vertical axis only.
+ * 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.
*
* @name Phaser.Physics.Arcade.Body#facing
* @type {integer}
* @since 3.0.0
+ *
+ * @see Phaser.Physics.Arcade.FACING_UP
+ * @see Phaser.Physics.Arcade.FACING_DOWN
+ * @see Phaser.Physics.Arcade.FACING_LEFT
+ * @see Phaser.Physics.Arcade.FACING_RIGHT
*/
this.facing = CONST.FACING_NONE;
@@ -96887,6 +100254,30 @@ var Body = new Class({
this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight);
},
+ /**
+ * Updates the Body's `position`, `width`, `height`, and `center` from its Game Object and `offset`.
+ *
+ * You don't need to call this for Dynamic Bodies, as it happens automatically during the physics step.
+ * But you could use it if you have modified the Body offset or Game Object transform and need to immediately
+ * read the Body's new `position` or `center`.
+ *
+ * To resynchronize the Body with its Game Object, use `reset()` instead.
+ *
+ * @method Phaser.Physics.Arcade.Body#updateFromGameObject
+ * @since 3.24.0
+ */
+ updateFromGameObject: function ()
+ {
+ this.updateBounds();
+
+ var transform = this.transform;
+
+ this.position.x = transform.x + transform.scaleX * (this.offset.x - transform.displayOriginX);
+ this.position.y = transform.y + transform.scaleY * (this.offset.y - transform.displayOriginY);
+
+ this.updateCenter();
+ },
+
/**
* Prepares the Body for a physics step by resetting the `wasTouching`, `touching` and `blocked` states.
*
@@ -96898,23 +100289,27 @@ var Body = new Class({
resetFlags: function ()
{
// Store and reset collision flags
- this.wasTouching.none = this.touching.none;
- this.wasTouching.up = this.touching.up;
- this.wasTouching.down = this.touching.down;
- this.wasTouching.left = this.touching.left;
- this.wasTouching.right = this.touching.right;
+ var wasTouching = this.wasTouching;
+ var touching = this.touching;
+ var blocked = this.blocked;
- this.touching.none = true;
- this.touching.up = false;
- this.touching.down = false;
- this.touching.left = false;
- this.touching.right = false;
+ wasTouching.none = touching.none;
+ wasTouching.up = touching.up;
+ wasTouching.down = touching.down;
+ wasTouching.left = touching.left;
+ wasTouching.right = touching.right;
- this.blocked.none = true;
- this.blocked.up = false;
- this.blocked.down = false;
- this.blocked.left = false;
- this.blocked.right = false;
+ touching.none = true;
+ touching.up = false;
+ touching.down = false;
+ touching.left = false;
+ touching.right = false;
+
+ blocked.none = true;
+ blocked.up = false;
+ blocked.down = false;
+ blocked.left = false;
+ blocked.right = false;
this.overlapR = 0;
this.overlapX = 0;
@@ -96941,17 +100336,9 @@ var Body = new Class({
this.resetFlags();
}
- this.updateBounds();
-
- var sprite = this.transform;
-
- this.position.x = sprite.x + sprite.scaleX * (this.offset.x - sprite.displayOriginX);
- this.position.y = sprite.y + sprite.scaleY * (this.offset.y - sprite.displayOriginY);
-
- this.updateCenter();
-
- this.rotation = sprite.rotation;
+ this.updateFromGameObject();
+ this.rotation = this.transform.rotation;
this.preRotation = this.rotation;
if (this.moves)
@@ -97096,7 +100483,7 @@ var Body = new Class({
* @since 3.20
*
* @param {?Phaser.Geom.Rectangle} [bounds] - The new boundary rectangle. Pass `null` to use the World bounds.
- *
+ *
* @return {this} This Body object.
*/
setBoundsRectangle: function (bounds)
@@ -97185,7 +100572,7 @@ var Body = new Class({
},
/**
- * Sizes and positions this Body's boundary, as a rectangle.
+ * Sizes and positions this Body, as a rectangle.
* Modifies the Body `offset` if `center` is true (the default).
* Resets the width and height to match current frame, if no width and height provided and a frame is found.
*
@@ -97227,10 +100614,10 @@ var Body = new Class({
if (center && gameObject.getCenter)
{
- var ox = gameObject.displayWidth / 2;
- var oy = gameObject.displayHeight / 2;
+ var ox = (gameObject.width - width) / 2;
+ var oy = (gameObject.height - height) / 2;
- this.offset.set(ox - this.halfWidth, oy - this.halfHeight);
+ this.offset.set(ox, oy);
}
this.isCircle = false;
@@ -97240,7 +100627,7 @@ var Body = new Class({
},
/**
- * Sizes and positions this Body's boundary, as a circle.
+ * Sizes and positions this Body, as a circle.
*
* @method Phaser.Physics.Arcade.Body#setCircle
* @since 3.0.0
@@ -97359,7 +100746,7 @@ var Body = new Class({
},
/**
- * Tests if the coordinates are within this Body's boundary.
+ * Tests if the coordinates are within this Body.
*
* @method Phaser.Physics.Arcade.Body#hitTest
* @since 3.0.0
@@ -97459,7 +100846,7 @@ var Body = new Class({
/**
* The change in this Body's horizontal position from the previous step.
* This value is set during the Body's update phase.
- *
+ *
* As a Body can update multiple times per step this may not hold the final
* delta value for the Body. In this case, please see the `deltaXFinal` method.
*
@@ -97476,7 +100863,7 @@ var Body = new Class({
/**
* The change in this Body's vertical position from the previous step.
* This value is set during the Body's update phase.
- *
+ *
* As a Body can update multiple times per step this may not hold the final
* delta value for the Body. In this case, please see the `deltaYFinal` method.
*
@@ -97492,10 +100879,10 @@ var Body = new Class({
/**
* The change in this Body's horizontal position from the previous game update.
- *
+ *
* This value is set during the `postUpdate` phase and takes into account the
* `deltaMax` and final position of the Body.
- *
+ *
* Because this value is not calculated until `postUpdate`, you must listen for it
* during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will
* not be calculated by that point. If you _do_ use these values in `update` they
@@ -97513,10 +100900,10 @@ var Body = new Class({
/**
* The change in this Body's vertical position from the previous game update.
- *
+ *
* This value is set during the `postUpdate` phase and takes into account the
* `deltaMax` and final position of the Body.
- *
+ *
* Because this value is not calculated until `postUpdate`, you must listen for it
* during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will
* not be calculated by that point. If you _do_ use these values in `update` they
@@ -97562,7 +100949,7 @@ var Body = new Class({
},
/**
- * Draws this Body's boundary and velocity, if enabled.
+ * Draws this Body and its velocity, if enabled.
*
* @method Phaser.Physics.Arcade.Body#drawDebug
* @since 3.0.0
@@ -98244,7 +101631,7 @@ var Body = new Class({
},
/**
- * The left edge of the Body's boundary. Identical to x.
+ * The left edge of the Body. Identical to x.
*
* @name Phaser.Physics.Arcade.Body#left
* @type {number}
@@ -98261,7 +101648,7 @@ var Body = new Class({
},
/**
- * The right edge of the Body's boundary.
+ * The right edge of the Body.
*
* @name Phaser.Physics.Arcade.Body#right
* @type {number}
@@ -98278,7 +101665,7 @@ var Body = new Class({
},
/**
- * The top edge of the Body's boundary. Identical to y.
+ * The top edge of the Body. Identical to y.
*
* @name Phaser.Physics.Arcade.Body#top
* @type {number}
@@ -98295,7 +101682,7 @@ var Body = new Class({
},
/**
- * The bottom edge of this Body's boundary.
+ * The bottom edge of this Body.
*
* @name Phaser.Physics.Arcade.Body#bottom
* @type {number}
@@ -98317,7 +101704,7 @@ module.exports = Body;
/***/ }),
-/* 459 */
+/* 468 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -98500,7 +101887,7 @@ module.exports = Collider;
/***/ }),
-/* 460 */
+/* 469 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -98509,7 +101896,7 @@ module.exports = Collider;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CONST = __webpack_require__(50);
+var CONST = __webpack_require__(51);
/**
* Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties
@@ -98608,7 +101995,7 @@ module.exports = GetOverlapX;
/***/ }),
-/* 461 */
+/* 470 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -98617,7 +102004,7 @@ module.exports = GetOverlapX;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CONST = __webpack_require__(50);
+var CONST = __webpack_require__(51);
/**
* Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties
@@ -98716,7 +102103,7 @@ module.exports = GetOverlapY;
/***/ }),
-/* 462 */
+/* 471 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -98726,7 +102113,7 @@ module.exports = GetOverlapY;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var quickselect = __webpack_require__(383);
+var quickselect = __webpack_require__(391);
/**
* @classdesc
@@ -99327,7 +102714,7 @@ function multiSelect (arr, left, right, n, compare)
module.exports = rbush;
/***/ }),
-/* 463 */
+/* 472 */
/***/ (function(module, exports) {
/**
@@ -99363,7 +102750,7 @@ module.exports = TileIntersectsBody;
/***/ }),
-/* 464 */
+/* 473 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -99372,10 +102759,10 @@ module.exports = TileIntersectsBody;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CircleContains = __webpack_require__(55);
+var CircleContains = __webpack_require__(56);
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(50);
-var RectangleContains = __webpack_require__(47);
+var CONST = __webpack_require__(51);
+var RectangleContains = __webpack_require__(48);
var Vector2 = __webpack_require__(3);
/**
@@ -99383,7 +102770,7 @@ var Vector2 = __webpack_require__(3);
* A Static Arcade Physics Body.
*
* A Static Body never moves, and isn't automatically synchronized with its parent Game Object.
- * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Body manually.
+ * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Static Body manually.
*
* A Static Body can collide with other Bodies, but is never moved by collisions.
*
@@ -99403,8 +102790,8 @@ var StaticBody = new Class({
function StaticBody (world, gameObject)
{
- var width = (gameObject.width) ? gameObject.width : 64;
- var height = (gameObject.height) ? gameObject.height : 64;
+ var width = (gameObject.displayWidth) ? gameObject.displayWidth : 64;
+ var height = (gameObject.displayHeight) ? gameObject.displayHeight : 64;
/**
* The Arcade Physics simulation this Static Body belongs to.
@@ -99463,8 +102850,8 @@ var StaticBody = new Class({
this.isCircle = false;
/**
- * If this Static Body is circular, this is the unscaled radius of the Static Body's boundary, as set by {@link #setCircle}, in source pixels.
- * The true radius is equal to `halfWidth`.
+ * If this Static Body is circular, this is the radius of the boundary, as set by {@link Phaser.Physics.Arcade.StaticBody#setCircle}, in pixels.
+ * Equal to `halfWidth`.
*
* @name Phaser.Physics.Arcade.StaticBody#radius
* @type {number}
@@ -99474,12 +102861,13 @@ var StaticBody = new Class({
this.radius = 0;
/**
- * The offset of this Static Body's actual position from any updated position.
+ * The offset set by {@link Phaser.Physics.Arcade.StaticBody#setCircle} or {@link Phaser.Physics.Arcade.StaticBody#setSize}.
*
- * Unlike a dynamic Body, a Static Body does not follow its Game Object. As such, this offset is only applied when resizing the Static Body.
+ * This doesn't affect the Static Body's position, because a Static Body does not follow its Game Object.
*
* @name Phaser.Physics.Arcade.StaticBody#offset
* @type {Phaser.Math.Vector2}
+ * @readonly
* @since 3.0.0
*/
this.offset = new Vector2();
@@ -99491,7 +102879,7 @@ var StaticBody = new Class({
* @type {Phaser.Math.Vector2}
* @since 3.0.0
*/
- this.position = new Vector2(gameObject.x - gameObject.displayOriginX, gameObject.y - gameObject.displayOriginY);
+ this.position = new Vector2(gameObject.x - (width * gameObject.originX), gameObject.y - (height * gameObject.originY));
/**
* The width of the Static Body's boundary, in pixels.
@@ -99541,7 +102929,7 @@ var StaticBody = new Class({
* @type {Phaser.Math.Vector2}
* @since 3.0.0
*/
- this.center = new Vector2(gameObject.x + this.halfWidth, gameObject.y + this.halfHeight);
+ this.center = new Vector2(this.position.x + this.halfWidth, this.position.y + this.halfHeight);
/**
* A constant zero velocity used by the Arcade Physics simulation for calculations.
@@ -99757,7 +103145,7 @@ var StaticBody = new Class({
this.physicsType = CONST.STATIC_BODY;
/**
- * The calculated change in the Body's horizontal position during the current step.
+ * The calculated change in the Static Body's horizontal position during the current step.
* For a static body this is always zero.
*
* @name Phaser.Physics.Arcade.StaticBody#_dx
@@ -99769,7 +103157,7 @@ var StaticBody = new Class({
this._dx = 0;
/**
- * The calculated change in the Body's vertical position during the current step.
+ * The calculated change in the Static Body's vertical position during the current step.
* For a static body this is always zero.
*
* @name Phaser.Physics.Arcade.StaticBody#_dy
@@ -99818,7 +103206,7 @@ var StaticBody = new Class({
},
/**
- * Syncs the Body's position and size with its parent Game Object.
+ * Syncs the Static Body's position and size with its parent Game Object.
*
* @method Phaser.Physics.Arcade.StaticBody#updateFromGameObject
* @since 3.1.0
@@ -99847,13 +103235,13 @@ var StaticBody = new Class({
},
/**
- * Sets the offset of the body.
+ * Positions the Static Body at an offset from its Game Object.
*
* @method Phaser.Physics.Arcade.StaticBody#setOffset
* @since 3.4.0
*
- * @param {number} x - The horizontal offset of the Body from the Game Object's center.
- * @param {number} y - The vertical offset of the Body from the Game Object's center.
+ * @param {number} x - The horizontal offset of the Static Body from the Game Object's `x`.
+ * @param {number} y - The vertical offset of the Static Body from the Game Object's `y`.
*
* @return {Phaser.Physics.Arcade.StaticBody} This Static Body object.
*/
@@ -99879,15 +103267,16 @@ var StaticBody = new Class({
},
/**
- * Sets the size of the body.
+ * Sets the size of the Static Body.
+ * When `center` is true, also repositions it.
* Resets the width and height to match current frame, if no width and height provided and a frame is found.
*
* @method Phaser.Physics.Arcade.StaticBody#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 {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.
+ * @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 {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.
*/
@@ -99940,7 +103329,7 @@ var StaticBody = new Class({
},
/**
- * Sets this Static Body to have a circular body and sets its sizes and position.
+ * Sets this Static Body to have a circular body and sets its size and position.
*
* @method Phaser.Physics.Arcade.StaticBody#setCircle
* @since 3.0.0
@@ -100350,10 +103739,8 @@ module.exports = StaticBody;
/***/ }),
-/* 465 */,
-/* 466 */,
-/* 467 */,
-/* 468 */
+/* 474 */,
+/* 475 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -100483,7 +103870,7 @@ module.exports = BasePlugin;
/***/ }),
-/* 469 */
+/* 476 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -100528,7 +103915,7 @@ module.exports = ReplaceByIndex;
/***/ }),
-/* 470 */
+/* 477 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -100537,7 +103924,7 @@ module.exports = ReplaceByIndex;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var IsInLayerBounds = __webpack_require__(103);
+var IsInLayerBounds = __webpack_require__(102);
/**
* Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns
@@ -100571,7 +103958,7 @@ module.exports = HasTileAt;
/***/ }),
-/* 471 */
+/* 478 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -100581,8 +103968,8 @@ module.exports = HasTileAt;
*/
var Tile = __webpack_require__(74);
-var IsInLayerBounds = __webpack_require__(103);
-var CalculateFacesAt = __webpack_require__(217);
+var IsInLayerBounds = __webpack_require__(102);
+var CalculateFacesAt = __webpack_require__(226);
/**
* Removes the tile at the given tile coordinates in the specified layer and updates the layer's
@@ -100634,7 +104021,7 @@ module.exports = RemoveTileAt;
/***/ }),
-/* 472 */
+/* 479 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -100643,11 +104030,11 @@ module.exports = RemoveTileAt;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Formats = __webpack_require__(31);
-var Parse2DArray = __webpack_require__(220);
-var ParseCSV = __webpack_require__(473);
-var ParseJSONTiled = __webpack_require__(474);
-var ParseWeltmeister = __webpack_require__(485);
+var Formats = __webpack_require__(32);
+var Parse2DArray = __webpack_require__(229);
+var ParseCSV = __webpack_require__(480);
+var ParseJSONTiled = __webpack_require__(481);
+var ParseWeltmeister = __webpack_require__(492);
/**
* Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format
@@ -100704,7 +104091,7 @@ module.exports = Parse;
/***/ }),
-/* 473 */
+/* 480 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -100713,8 +104100,8 @@ module.exports = Parse;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Formats = __webpack_require__(31);
-var Parse2DArray = __webpack_require__(220);
+var Formats = __webpack_require__(32);
+var Parse2DArray = __webpack_require__(229);
/**
* Parses a CSV string of tile indexes into a new MapData object with a single layer.
@@ -100752,7 +104139,7 @@ module.exports = ParseCSV;
/***/ }),
-/* 474 */
+/* 481 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -100761,14 +104148,14 @@ module.exports = ParseCSV;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Formats = __webpack_require__(31);
-var MapData = __webpack_require__(105);
-var ParseTileLayers = __webpack_require__(475);
-var ParseImageLayers = __webpack_require__(477);
-var ParseTilesets = __webpack_require__(478);
-var ParseObjectLayers = __webpack_require__(481);
-var BuildTilesetIndex = __webpack_require__(483);
-var AssignTileProperties = __webpack_require__(484);
+var Formats = __webpack_require__(32);
+var MapData = __webpack_require__(104);
+var ParseTileLayers = __webpack_require__(482);
+var ParseImageLayers = __webpack_require__(484);
+var ParseTilesets = __webpack_require__(485);
+var ParseObjectLayers = __webpack_require__(488);
+var BuildTilesetIndex = __webpack_require__(490);
+var AssignTileProperties = __webpack_require__(491);
/**
* Parses a Tiled JSON object into a new MapData object.
@@ -100830,7 +104217,7 @@ module.exports = ParseJSONTiled;
/***/ }),
-/* 475 */
+/* 482 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -100839,12 +104226,12 @@ module.exports = ParseJSONTiled;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Base64Decode = __webpack_require__(476);
+var Base64Decode = __webpack_require__(483);
var GetFastValue = __webpack_require__(2);
-var LayerData = __webpack_require__(104);
-var ParseGID = __webpack_require__(221);
+var LayerData = __webpack_require__(103);
+var ParseGID = __webpack_require__(230);
var Tile = __webpack_require__(74);
-var CreateGroupLayer = __webpack_require__(222);
+var CreateGroupLayer = __webpack_require__(231);
/**
* Parses all tilemap layers in a Tiled JSON object into new LayerData objects.
@@ -100962,7 +104349,7 @@ 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', [])
});
for (var c = 0; c < curl.height; c++)
@@ -101035,7 +104422,7 @@ 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', [])
});
var row = [];
@@ -101088,7 +104475,7 @@ module.exports = ParseTileLayers;
/***/ }),
-/* 476 */
+/* 483 */
/***/ (function(module, exports) {
/**
@@ -101131,7 +104518,7 @@ module.exports = Base64Decode;
/***/ }),
-/* 477 */
+/* 484 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -101141,7 +104528,7 @@ module.exports = Base64Decode;
*/
var GetFastValue = __webpack_require__(2);
-var CreateGroupLayer = __webpack_require__(222);
+var CreateGroupLayer = __webpack_require__(231);
/**
* Parses a Tiled JSON object into an array of objects with details about the image layers.
@@ -101219,7 +104606,7 @@ module.exports = ParseImageLayers;
/***/ }),
-/* 478 */
+/* 485 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -101228,9 +104615,9 @@ module.exports = ParseImageLayers;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Tileset = __webpack_require__(141);
-var ImageCollection = __webpack_require__(479);
-var ParseObject = __webpack_require__(223);
+var Tileset = __webpack_require__(105);
+var ImageCollection = __webpack_require__(486);
+var ParseObject = __webpack_require__(232);
/**
* Tilesets and Image Collections
@@ -101238,9 +104625,9 @@ var ParseObject = __webpack_require__(223);
* @function Phaser.Tilemaps.Parsers.Tiled.ParseTilesets
* @since 3.0.0
*
- * @param {object} json - [description]
+ * @param {object} json - The Tiled JSON data.
*
- * @return {object} [description]
+ * @return {object} An object containing the tileset and image collection data.
*/
var ParseTilesets = function (json)
{
@@ -101388,7 +104775,7 @@ module.exports = ParseTilesets;
/***/ }),
-/* 479 */
+/* 486 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -101560,7 +104947,7 @@ module.exports = ImageCollection;
/***/ }),
-/* 480 */
+/* 487 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -101569,7 +104956,7 @@ module.exports = ImageCollection;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var HasValue = __webpack_require__(99);
+var HasValue = __webpack_require__(109);
/**
* Returns a new object that only contains the `keys` that were found on the object provided.
@@ -101604,7 +104991,7 @@ module.exports = Pick;
/***/ }),
-/* 481 */
+/* 488 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -101614,9 +105001,9 @@ module.exports = Pick;
*/
var GetFastValue = __webpack_require__(2);
-var ParseObject = __webpack_require__(223);
-var ObjectLayer = __webpack_require__(482);
-var CreateGroupLayer = __webpack_require__(222);
+var ParseObject = __webpack_require__(232);
+var ObjectLayer = __webpack_require__(489);
+var CreateGroupLayer = __webpack_require__(231);
/**
* Parses a Tiled JSON object into an array of ObjectLayer objects.
@@ -101703,7 +105090,7 @@ module.exports = ParseObjectLayers;
/***/ }),
-/* 482 */
+/* 489 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -101825,8 +105212,8 @@ module.exports = ObjectLayer;
/***/ }),
-/* 483 */
-/***/ (function(module, exports) {
+/* 490 */
+/***/ (function(module, exports, __webpack_require__) {
/**
* @author Richard Davey
@@ -101834,23 +105221,44 @@ module.exports = ObjectLayer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
+var Tileset = __webpack_require__(105);
+
/**
* Master list of tiles -> x, y, index in tileset.
*
* @function Phaser.Tilemaps.Parsers.Tiled.BuildTilesetIndex
* @since 3.0.0
*
- * @param {Phaser.Tilemaps.MapData} mapData - [description]
+ * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object.
*
- * @return {array} [description]
+ * @return {array} An array of Tileset objects.
*/
var BuildTilesetIndex = function (mapData)
{
+ var i;
+ var set;
var tiles = [];
- for (var i = 0; i < mapData.tilesets.length; i++)
+ for (i = 0; i < mapData.imageCollections.length; i++)
{
- var set = mapData.tilesets[i];
+ 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);
+ }
+ }
+
+ for (i = 0; i < mapData.tilesets.length; i++)
+ {
+ set = mapData.tilesets[i];
var x = set.tileMargin;
var y = set.tileMargin;
@@ -101898,7 +105306,7 @@ module.exports = BuildTilesetIndex;
/***/ }),
-/* 484 */
+/* 491 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -101907,7 +105315,7 @@ module.exports = BuildTilesetIndex;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Extend = __webpack_require__(17);
+var Extend = __webpack_require__(19);
/**
* Copy properties from tileset to tiles.
@@ -101915,7 +105323,7 @@ var Extend = __webpack_require__(17);
* @function Phaser.Tilemaps.Parsers.Tiled.AssignTileProperties
* @since 3.0.0
*
- * @param {Phaser.Tilemaps.MapData} mapData - [description]
+ * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object.
*/
var AssignTileProperties = function (mapData)
{
@@ -101971,7 +105379,7 @@ module.exports = AssignTileProperties;
/***/ }),
-/* 485 */
+/* 492 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -101980,10 +105388,10 @@ module.exports = AssignTileProperties;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Formats = __webpack_require__(31);
-var MapData = __webpack_require__(105);
-var ParseTileLayers = __webpack_require__(486);
-var ParseTilesets = __webpack_require__(487);
+var Formats = __webpack_require__(32);
+var MapData = __webpack_require__(104);
+var ParseTileLayers = __webpack_require__(493);
+var ParseTilesets = __webpack_require__(494);
/**
* Parses a Weltmeister JSON object into a new MapData object.
@@ -102000,7 +105408,7 @@ var ParseTilesets = __webpack_require__(487);
* consumption. However if your map is small or you need to update the tiles dynamically, then leave
* the default value set.
*
- * @return {?object} [description]
+ * @return {?Phaser.Tilemaps.MapData} The created MapData object, or `null` if the data can't be parsed.
*/
var ParseWeltmeister = function (name, json, insertNull)
{
@@ -102038,7 +105446,7 @@ module.exports = ParseWeltmeister;
/***/ }),
-/* 486 */
+/* 493 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -102047,19 +105455,21 @@ module.exports = ParseWeltmeister;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var LayerData = __webpack_require__(104);
+var LayerData = __webpack_require__(103);
var Tile = __webpack_require__(74);
/**
- * [description]
+ * Parses all tilemap layers in an Impact JSON object into new LayerData objects.
*
* @function Phaser.Tilemaps.Parsers.Impact.ParseTileLayers
* @since 3.0.0
*
- * @param {object} json - [description]
- * @param {boolean} insertNull - [description]
+ * @param {object} json - The Impact 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} [description]
+ * @return {Phaser.Tilemaps.LayerData[]} - An array of LayerData objects, one for each entry in
+ * json.layers with the type 'tilelayer'.
*/
var ParseTileLayers = function (json, insertNull)
{
@@ -102122,7 +105532,7 @@ module.exports = ParseTileLayers;
/***/ }),
-/* 487 */
+/* 494 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -102131,17 +105541,17 @@ module.exports = ParseTileLayers;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Tileset = __webpack_require__(141);
+var Tileset = __webpack_require__(105);
/**
- * [description]
+ * Tilesets and Image Collections
*
* @function Phaser.Tilemaps.Parsers.Impact.ParseTilesets
* @since 3.0.0
*
- * @param {object} json - [description]
+ * @param {object} json - The Impact JSON data.
*
- * @return {array} [description]
+ * @return {array} An array of Tilesets.
*/
var ParseTilesets = function (json)
{
@@ -102173,7 +105583,7 @@ module.exports = ParseTilesets;
/***/ }),
-/* 488 */
+/* 495 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -102183,17 +105593,17 @@ module.exports = ParseTilesets;
*/
var Class = __webpack_require__(0);
-var DegToRad = __webpack_require__(35);
-var DynamicTilemapLayer = __webpack_require__(489);
-var Extend = __webpack_require__(17);
-var Formats = __webpack_require__(31);
-var LayerData = __webpack_require__(104);
-var Rotate = __webpack_require__(327);
-var SpliceOne = __webpack_require__(79);
-var StaticTilemapLayer = __webpack_require__(490);
+var DegToRad = __webpack_require__(39);
+var DynamicTilemapLayer = __webpack_require__(496);
+var Extend = __webpack_require__(19);
+var Formats = __webpack_require__(32);
+var LayerData = __webpack_require__(103);
+var Rotate = __webpack_require__(335);
+var SpliceOne = __webpack_require__(80);
+var StaticTilemapLayer = __webpack_require__(497);
var Tile = __webpack_require__(74);
-var TilemapComponents = __webpack_require__(137);
-var Tileset = __webpack_require__(141);
+var TilemapComponents = __webpack_require__(143);
+var Tileset = __webpack_require__(105);
/**
* @callback TilemapFilterCallback
@@ -102849,9 +106259,10 @@ var Tilemap = new Class({
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).
var offset = {
- x: sprite.originX * sprite.displayWidth,
- y: (sprite.originY - 1) * sprite.displayHeight
+ 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.
@@ -104062,7 +107473,6 @@ var Tilemap = new Class({
*
* @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.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@@ -104207,7 +107617,7 @@ var Tilemap = new Class({
/**
* 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).
+ * disabled (false). Tile indexes not currently in the layer are not affected.
*
* If no layer specified, the map's current layer is used.
*
@@ -104730,7 +108140,7 @@ module.exports = Tilemap;
/***/ }),
-/* 489 */
+/* 496 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -104741,9 +108151,9 @@ module.exports = Tilemap;
var Class = __webpack_require__(0);
var Components = __webpack_require__(12);
-var DynamicTilemapLayerRender = __webpack_require__(1333);
+var DynamicTilemapLayerRender = __webpack_require__(1351);
var GameObject = __webpack_require__(14);
-var TilemapComponents = __webpack_require__(137);
+var TilemapComponents = __webpack_require__(143);
/**
* @classdesc
@@ -105767,7 +109177,7 @@ var DynamicTilemapLayer = new Class({
/**
* 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).
+ * disabled (false). Tile indexes not currently in the layer are not affected.
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByExclusion
* @since 3.0.0
@@ -106051,7 +109461,7 @@ module.exports = DynamicTilemapLayer;
/***/ }),
-/* 490 */
+/* 497 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -106062,11 +109472,12 @@ module.exports = DynamicTilemapLayer;
var Class = __webpack_require__(0);
var Components = __webpack_require__(12);
-var GameEvents = __webpack_require__(18);
+var GameEvents = __webpack_require__(20);
var GameObject = __webpack_require__(14);
-var StaticTilemapLayerRender = __webpack_require__(1336);
-var TilemapComponents = __webpack_require__(137);
-var TransformMatrix = __webpack_require__(32);
+var ModelViewProjection = __webpack_require__(151);
+var StaticTilemapLayerRender = __webpack_require__(1354);
+var TilemapComponents = __webpack_require__(143);
+var TransformMatrix = __webpack_require__(30);
var Utils = __webpack_require__(10);
/**
@@ -106076,7 +109487,7 @@ var Utils = __webpack_require__(10);
*
* 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
@@ -106096,6 +109507,7 @@ var Utils = __webpack_require__(10);
* @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.
@@ -106120,7 +109532,8 @@ var StaticTilemapLayer = new Class({
Components.Transform,
Components.Visible,
Components.ScrollFactor,
- StaticTilemapLayerRender
+ StaticTilemapLayerRender,
+ ModelViewProjection
],
initialize:
@@ -106172,7 +109585,7 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106193,7 +109606,7 @@ var StaticTilemapLayer = new Class({
/**
* 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.
*
@@ -106208,9 +109621,9 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106222,7 +109635,7 @@ var StaticTilemapLayer = new Class({
/**
* Canvas only.
- *
+ *
* The total number of tiles in this layer. Updated every frame.
*
* @name Phaser.Tilemaps.StaticTilemapLayer#tilesTotal
@@ -106234,7 +109647,7 @@ var StaticTilemapLayer = new Class({
/**
* 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.
@@ -106248,7 +109661,7 @@ var StaticTilemapLayer = new Class({
/**
* 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.
@@ -106262,7 +109675,7 @@ var StaticTilemapLayer = new Class({
/**
* 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.
@@ -106283,7 +109696,7 @@ var StaticTilemapLayer = new Class({
/**
* A reference to the renderer.
- *
+ *
* @name Phaser.Tilemaps.StaticTilemapLayer#renderer
* @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}
* @private
@@ -106293,9 +109706,9 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106305,9 +109718,9 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106317,9 +109730,9 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106329,9 +109742,9 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106341,9 +109754,9 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106353,9 +109766,9 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106365,17 +109778,17 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106415,6 +109828,8 @@ var StaticTilemapLayer = new Class({
this.initPipeline('TextureTintPipeline');
+ this.mvpInit();
+
scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function ()
{
this.updateVBOData();
@@ -106427,7 +109842,7 @@ var StaticTilemapLayer = new Class({
* @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)
@@ -106492,7 +109907,12 @@ var StaticTilemapLayer = new Class({
},
/**
- * Upload the tile data to a VBO.
+ * 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
@@ -106504,135 +109924,145 @@ var StaticTilemapLayer = new Class({
*/
upload: function (camera, tilesetIndex)
{
+ var pipeline = this.pipeline;
+
var renderer = this.renderer;
+
var gl = renderer.gl;
- var pipeline = renderer.pipelines.TextureTintPipeline;
+ var vertexBuffer = this.vertexBuffer[tilesetIndex];
+ var bufferData = this.bufferData[tilesetIndex];
- if (this.dirty[tilesetIndex])
+ if (!this.dirty[tilesetIndex] && vertexBuffer)
{
- var tileset = this.tileset[tilesetIndex];
- var mapWidth = this.layer.width;
- var mapHeight = this.layer.height;
- var width = tileset.image.source[0].width;
- var height = tileset.image.source[0].height;
- var mapData = this.layer.data;
- var tile;
- var row;
- var col;
- var renderOrder = this._renderOrder;
- var minTileIndex = tileset.firstgid;
- var maxTileIndex = tileset.firstgid + tileset.total;
-
- var vertexBuffer = this.vertexBuffer[tilesetIndex];
- var bufferData = this.bufferData[tilesetIndex];
- var vOffset = -1;
- var bufferSize = (mapWidth * mapHeight) * pipeline.vertexSize * 6;
+ renderer.setVertexBuffer(vertexBuffer);
- this.vertexCount[tilesetIndex] = 0;
-
- if (bufferData === null)
- {
- bufferData = new ArrayBuffer(bufferSize);
+ pipeline.setAttribPointers();
- this.bufferData[tilesetIndex] = bufferData;
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData);
- this.vertexViewF32[tilesetIndex] = new Float32Array(bufferData);
- this.vertexViewU32[tilesetIndex] = new Uint32Array(bufferData);
- }
-
- if (renderOrder === 0)
+ 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++)
{
- // right-down
-
- for (row = 0; row < mapHeight; row++)
+ for (col = 0; col < mapWidth; col++)
{
- for (col = 0; col < mapWidth; col++)
+ tile = mapData[row][col];
+
+ if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible)
{
- 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);
+ 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;
- }
- else
- {
- renderer.setVertexBuffer(vertexBuffer);
-
- gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData);
- }
}
+ 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;
},
@@ -106733,6 +110163,7 @@ var StaticTilemapLayer = new Class({
vertexViewF32[++vOffset] = u0;
vertexViewF32[++vOffset] = v0;
vertexViewF32[++vOffset] = 0;
+ vertexViewF32[++vOffset] = 0;
vertexViewU32[++vOffset] = tint;
vertexViewF32[++vOffset] = tx1;
@@ -106740,6 +110171,7 @@ var StaticTilemapLayer = new Class({
vertexViewF32[++vOffset] = u0;
vertexViewF32[++vOffset] = v1;
vertexViewF32[++vOffset] = 0;
+ vertexViewF32[++vOffset] = 0;
vertexViewU32[++vOffset] = tint;
vertexViewF32[++vOffset] = tx2;
@@ -106747,6 +110179,7 @@ var StaticTilemapLayer = new Class({
vertexViewF32[++vOffset] = u1;
vertexViewF32[++vOffset] = v1;
vertexViewF32[++vOffset] = 0;
+ vertexViewF32[++vOffset] = 0;
vertexViewU32[++vOffset] = tint;
vertexViewF32[++vOffset] = tx0;
@@ -106754,6 +110187,7 @@ var StaticTilemapLayer = new Class({
vertexViewF32[++vOffset] = u0;
vertexViewF32[++vOffset] = v0;
vertexViewF32[++vOffset] = 0;
+ vertexViewF32[++vOffset] = 0;
vertexViewU32[++vOffset] = tint;
vertexViewF32[++vOffset] = tx2;
@@ -106761,6 +110195,7 @@ var StaticTilemapLayer = new Class({
vertexViewF32[++vOffset] = u1;
vertexViewF32[++vOffset] = v1;
vertexViewF32[++vOffset] = 0;
+ vertexViewF32[++vOffset] = 0;
vertexViewU32[++vOffset] = tint;
vertexViewF32[++vOffset] = tx3;
@@ -106768,6 +110203,7 @@ var StaticTilemapLayer = new Class({
vertexViewF32[++vOffset] = u1;
vertexViewF32[++vOffset] = v0;
vertexViewF32[++vOffset] = 0;
+ vertexViewF32[++vOffset] = 0;
vertexViewU32[++vOffset] = tint;
this.vertexCount[tilesetIndex] += 6;
@@ -106777,20 +110213,20 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -106907,7 +110343,7 @@ var StaticTilemapLayer = new Class({
/**
* 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.
*
@@ -106931,7 +110367,7 @@ var StaticTilemapLayer = new Class({
/**
* 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
@@ -107285,7 +110721,7 @@ var StaticTilemapLayer = new Class({
/**
* 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).
+ * disabled (false). Tile indexes not currently in the layer are not affected.
*
* @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByExclusion
* @since 3.0.0
@@ -107494,7 +110930,7 @@ var StaticTilemapLayer = new Class({
*
* @method Phaser.Tilemaps.StaticTilemapLayer#destroy
* @since 3.0.0
- *
+ *
* @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap?
*/
destroy: function (removeFromTilemap)
@@ -107545,7 +110981,7 @@ module.exports = StaticTilemapLayer;
/***/ }),
-/* 491 */
+/* 498 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -107858,7 +111294,7 @@ module.exports = TimerEvent;
/***/ }),
-/* 492 */
+/* 499 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -107867,7 +111303,7 @@ module.exports = TimerEvent;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RESERVED = __webpack_require__(1345);
+var RESERVED = __webpack_require__(1368);
/**
* Internal function used by the Tween Builder to return an array of properties
@@ -107919,7 +111355,7 @@ module.exports = GetProps;
/***/ }),
-/* 493 */
+/* 500 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -107967,7 +111403,7 @@ module.exports = GetTweens;
/***/ }),
-/* 494 */
+/* 501 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -107976,15 +111412,15 @@ module.exports = GetTweens;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Defaults = __webpack_require__(227);
+var Defaults = __webpack_require__(236);
var GetAdvancedValue = __webpack_require__(15);
var GetBoolean = __webpack_require__(88);
-var GetEaseFunction = __webpack_require__(82);
-var GetNewValue = __webpack_require__(142);
+var GetEaseFunction = __webpack_require__(69);
+var GetNewValue = __webpack_require__(147);
var GetValue = __webpack_require__(6);
-var GetValueOp = __webpack_require__(226);
-var Tween = __webpack_require__(228);
-var TweenData = __webpack_require__(230);
+var GetValueOp = __webpack_require__(235);
+var Tween = __webpack_require__(237);
+var TweenData = __webpack_require__(239);
/**
* Creates a new Number Tween.
@@ -108097,7 +111533,7 @@ module.exports = NumberTweenBuilder;
/***/ }),
-/* 495 */
+/* 502 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -108106,7 +111542,7 @@ module.exports = NumberTweenBuilder;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetEaseFunction = __webpack_require__(82);
+var GetEaseFunction = __webpack_require__(69);
var GetValue = __webpack_require__(6);
var MATH_CONST = __webpack_require__(13);
@@ -108343,7 +111779,7 @@ module.exports = StaggerBuilder;
/***/ }),
-/* 496 */
+/* 503 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -108353,16 +111789,16 @@ module.exports = StaggerBuilder;
*/
var Clone = __webpack_require__(67);
-var Defaults = __webpack_require__(227);
+var Defaults = __webpack_require__(236);
var GetAdvancedValue = __webpack_require__(15);
var GetBoolean = __webpack_require__(88);
-var GetEaseFunction = __webpack_require__(82);
-var GetNewValue = __webpack_require__(142);
-var GetTargets = __webpack_require__(225);
-var GetTweens = __webpack_require__(493);
+var GetEaseFunction = __webpack_require__(69);
+var GetNewValue = __webpack_require__(147);
+var GetTargets = __webpack_require__(234);
+var GetTweens = __webpack_require__(500);
var GetValue = __webpack_require__(6);
-var Timeline = __webpack_require__(497);
-var TweenBuilder = __webpack_require__(143);
+var Timeline = __webpack_require__(504);
+var TweenBuilder = __webpack_require__(148);
/**
* Builds a Timeline of Tweens based on a configuration object.
@@ -108379,48 +111815,6 @@ var TimelineBuilder = function (manager, config)
{
var timeline = new Timeline(manager);
- var tweens = GetTweens(config);
-
- if (tweens.length === 0)
- {
- timeline.paused = true;
-
- return timeline;
- }
-
- var defaults = Clone(Defaults);
-
- defaults.targets = GetTargets(config);
-
- // totalDuration: If specified each tween in the Timeline is given an equal portion of the totalDuration
-
- var totalDuration = GetAdvancedValue(config, 'totalDuration', 0);
-
- if (totalDuration > 0)
- {
- defaults.duration = Math.floor(totalDuration / tweens.length);
- }
- else
- {
- defaults.duration = GetNewValue(config, 'duration', defaults.duration);
- }
-
- defaults.delay = GetNewValue(config, 'delay', defaults.delay);
- defaults.easeParams = GetValue(config, 'easeParams', defaults.easeParams);
- defaults.ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), defaults.easeParams);
- defaults.hold = GetNewValue(config, 'hold', defaults.hold);
- defaults.repeat = GetNewValue(config, 'repeat', defaults.repeat);
- defaults.repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay);
- defaults.yoyo = GetBoolean(config, 'yoyo', defaults.yoyo);
- defaults.flipX = GetBoolean(config, 'flipX', defaults.flipX);
- defaults.flipY = GetBoolean(config, 'flipY', defaults.flipY);
-
- // Create the Tweens
- for (var i = 0; i < tweens.length; i++)
- {
- timeline.queue(TweenBuilder(timeline, tweens[i], defaults));
- }
-
timeline.completeDelay = GetAdvancedValue(config, 'completeDelay', 0);
timeline.loop = Math.round(GetAdvancedValue(config, 'loop', 0));
timeline.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0));
@@ -108488,6 +111882,50 @@ var TimelineBuilder = function (manager, config)
timeline.setCallback('onComplete', onComplete, timelineArray.concat(onCompleteParams), onCompleteScope);
}
+ // Tweens
+
+ var tweens = GetTweens(config);
+
+ if (tweens.length === 0)
+ {
+ timeline.paused = true;
+
+ return timeline;
+ }
+
+ var defaults = Clone(Defaults);
+
+ defaults.targets = GetTargets(config);
+
+ // totalDuration: If specified each tween in the Timeline is given an equal portion of the totalDuration
+
+ var totalDuration = GetAdvancedValue(config, 'totalDuration', 0);
+
+ if (totalDuration > 0)
+ {
+ defaults.duration = Math.floor(totalDuration / tweens.length);
+ }
+ else
+ {
+ defaults.duration = GetNewValue(config, 'duration', defaults.duration);
+ }
+
+ defaults.delay = GetNewValue(config, 'delay', defaults.delay);
+ defaults.easeParams = GetValue(config, 'easeParams', defaults.easeParams);
+ defaults.ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), defaults.easeParams);
+ defaults.hold = GetNewValue(config, 'hold', defaults.hold);
+ defaults.repeat = GetNewValue(config, 'repeat', defaults.repeat);
+ defaults.repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay);
+ defaults.yoyo = GetBoolean(config, 'yoyo', defaults.yoyo);
+ defaults.flipX = GetBoolean(config, 'flipX', defaults.flipX);
+ defaults.flipY = GetBoolean(config, 'flipY', defaults.flipY);
+
+ // Create the Tweens
+ for (var i = 0; i < tweens.length; i++)
+ {
+ timeline.queue(TweenBuilder(timeline, tweens[i], defaults));
+ }
+
return timeline;
};
@@ -108495,7 +111933,7 @@ module.exports = TimelineBuilder;
/***/ }),
-/* 497 */
+/* 504 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -108505,9 +111943,9 @@ module.exports = TimelineBuilder;
*/
var Class = __webpack_require__(0);
-var EventEmitter = __webpack_require__(9);
-var Events = __webpack_require__(229);
-var TweenBuilder = __webpack_require__(143);
+var EventEmitter = __webpack_require__(11);
+var Events = __webpack_require__(238);
+var TweenBuilder = __webpack_require__(148);
var TWEEN_CONST = __webpack_require__(89);
/**
@@ -109400,7 +112838,7 @@ module.exports = Timeline;
/***/ }),
-/* 498 */
+/* 505 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -109409,9 +112847,9 @@ module.exports = Timeline;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BaseAnimation = __webpack_require__(148);
+var BaseAnimation = __webpack_require__(155);
var Class = __webpack_require__(0);
-var Events = __webpack_require__(111);
+var Events = __webpack_require__(112);
/**
* @classdesc
@@ -109492,6 +112930,15 @@ var Animation = new Class({
*/
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.
*
@@ -109702,14 +113149,14 @@ var Animation = new Class({
/**
* 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
@@ -109726,7 +113173,14 @@ var Animation = new Class({
key = key.key;
}
- this.nextAnim = key;
+ if (this.nextAnim === null)
+ {
+ this.nextAnim = key;
+ }
+ else
+ {
+ this.nextAnimsQueue.push(key);
+ }
return this.parent;
},
@@ -109901,7 +113355,7 @@ var Animation = new Class({
/**
* 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
@@ -109975,9 +113429,9 @@ var Animation = new Class({
* Load an Animation and fires 'onStartEvent' event, extracted from 'play' method.
*
* @method Phaser.GameObjects.Components.Animation#_startAnimation
- * @fires Phaser.Animations.Events#START_ANIMATION_EVENT
- * @fires Phaser.Animations.Events#SPRITE_START_ANIMATION_EVENT
- * @fires Phaser.Animations.Events#SPRITE_START_KEY_ANIMATION_EVENT
+ * @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.
@@ -110182,9 +113636,9 @@ var Animation = new Class({
* Restarts the current animation from its beginning, optionally including its delay value.
*
* @method Phaser.GameObjects.Components.Animation#restart
- * @fires Phaser.Animations.Events#RESTART_ANIMATION_EVENT
- * @fires Phaser.Animations.Events#SPRITE_RESTART_ANIMATION_EVENT
- * @fires Phaser.Animations.Events#SPRITE_RESTART_KEY_ANIMATION_EVENT
+ * @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.
@@ -110221,9 +113675,9 @@ var Animation = new Class({
/**
* 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
@@ -110247,7 +113701,7 @@ var Animation = new Class({
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);
}
@@ -110255,7 +113709,7 @@ var Animation = new Class({
{
var key = this.nextAnim;
- this.nextAnim = null;
+ this.nextAnim = (this.nextAnimsQueue.length > 0) ? this.nextAnimsQueue.shift() : null;
this.play(key);
}
@@ -110425,13 +113879,16 @@ var Animation = new Class({
gameObject.setSizeToFrame();
- if (animationFrame.frame.customPivot)
+ if (gameObject._originComponent)
{
- gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY);
- }
- else
- {
- gameObject.updateDisplayOrigin();
+ if (animationFrame.frame.customPivot)
+ {
+ gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY);
+ }
+ else
+ {
+ gameObject.updateDisplayOrigin();
+ }
}
return gameObject;
@@ -110441,8 +113898,8 @@ var Animation = new Class({
* Internal frame change handler.
*
* @method Phaser.GameObjects.Components.Animation#updateFrame
- * @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE_EVENT
- * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE_EVENT
+ * @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE
+ * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE
* @private
* @since 3.0.0
*
@@ -110475,7 +113932,7 @@ var Animation = new Class({
/**
* 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.
*
@@ -110497,7 +113954,7 @@ var Animation = new Class({
/**
* 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.
*
@@ -110564,6 +114021,7 @@ var Animation = new Class({
this.animationManager = null;
this.parent = null;
+ this.nextAnimsQueue.length = 0;
this.currentAnim = null;
this.currentFrame = null;
@@ -110575,7 +114033,7 @@ module.exports = Animation;
/***/ }),
-/* 499 */
+/* 506 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -110585,13 +114043,13 @@ module.exports = Animation;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CanvasSnapshot = __webpack_require__(500);
-var CameraEvents = __webpack_require__(48);
+var CanvasSnapshot = __webpack_require__(507);
+var CameraEvents = __webpack_require__(40);
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(29);
-var GetBlendModes = __webpack_require__(501);
+var CONST = __webpack_require__(33);
+var GetBlendModes = __webpack_require__(508);
var ScaleEvents = __webpack_require__(92);
-var TransformMatrix = __webpack_require__(32);
+var TransformMatrix = __webpack_require__(30);
/**
* @classdesc
@@ -110725,7 +114183,7 @@ var CanvasRenderer = new Class({
/**
* Details about the currently scheduled snapshot.
- *
+ *
* If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered.
*
* @name Phaser.Renderer.Canvas.CanvasRenderer#snapshotState
@@ -111036,7 +114494,10 @@ var CanvasRenderer = new Class({
{
camera.emit(CameraEvents.POST_RENDER, camera);
- scene.sys.context.drawImage(camera.canvas, cx, cy);
+ if (camera.renderToGame)
+ {
+ scene.sys.context.drawImage(camera.canvas, cx, cy);
+ }
}
},
@@ -111066,9 +114527,9 @@ var CanvasRenderer = new Class({
/**
* Takes a snapshot of the given area of the given canvas.
- *
+ *
* Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render.
- *
+ *
* Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets
* more expensive the larger the canvas size gets, so please be careful how you employ this in your game.
*
@@ -111106,12 +114567,12 @@ var CanvasRenderer = new Class({
/**
* Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered.
- *
+ *
* To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`.
- *
+ *
* Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then
* calling this method will override it.
- *
+ *
* Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets
* more expensive the larger the canvas size gets, so please be careful how you employ this in your game.
*
@@ -111131,12 +114592,12 @@ var CanvasRenderer = new Class({
/**
* Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered.
- *
+ *
* To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`.
- *
+ *
* Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then
* calling this method will override it.
- *
+ *
* Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets
* more expensive the larger the canvas size gets, so please be careful how you employ this in your game.
*
@@ -111171,12 +114632,12 @@ var CanvasRenderer = new Class({
/**
* Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered.
- *
+ *
* To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`.
- *
+ *
* Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then
* calling this method will override it.
- *
+ *
* Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for
* the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute,
* using less memory.
@@ -111219,7 +114680,7 @@ var CanvasRenderer = new Class({
// Nothing to see, so abort early
return;
}
-
+
var ctx = this.currentContext;
var camMatrix = this._tempMatrix1;
@@ -111253,7 +114714,7 @@ var CanvasRenderer = new Class({
frameWidth = crop.cw;
frameHeight = crop.ch;
-
+
frameX = crop.cx;
frameY = crop.cy;
@@ -111271,7 +114732,7 @@ var CanvasRenderer = new Class({
x = (Math.abs(x) - frameWidth);
}
}
-
+
if (sprite.flipY)
{
if (y >= 0)
@@ -111329,13 +114790,13 @@ var CanvasRenderer = new Class({
{
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);
}
ctx.save();
-
+
calcMatrix.setToContext(ctx);
ctx.globalCompositeOperation = this.blendModes[sprite.blendMode];
@@ -111344,8 +114805,18 @@ var CanvasRenderer = new Class({
ctx.imageSmoothingEnabled = !(!this.antialias || frame.source.scaleMode);
+ if (sprite.mask)
+ {
+ sprite.mask.preRenderCanvas(this, sprite, camera);
+ }
+
ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res);
+ if (sprite.mask)
+ {
+ sprite.mask.postRenderCanvas(this, sprite, camera);
+ }
+
ctx.restore();
},
@@ -111369,7 +114840,7 @@ module.exports = CanvasRenderer;
/***/ }),
-/* 500 */
+/* 507 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -111379,7 +114850,7 @@ module.exports = CanvasRenderer;
*/
var CanvasPool = __webpack_require__(26);
-var Color = __webpack_require__(33);
+var Color = __webpack_require__(31);
var GetFastValue = __webpack_require__(2);
/**
@@ -111462,7 +114933,7 @@ module.exports = CanvasSnapshot;
/***/ }),
-/* 501 */
+/* 508 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -111471,8 +114942,8 @@ module.exports = CanvasSnapshot;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var modes = __webpack_require__(52);
-var CanvasFeatures = __webpack_require__(313);
+var modes = __webpack_require__(53);
+var CanvasFeatures = __webpack_require__(320);
/**
* Returns an array which maps the default blend modes to supported Canvas blend modes.
@@ -111526,7 +114997,7 @@ module.exports = GetBlendModes;
/***/ }),
-/* 502 */
+/* 509 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -111537,23 +115008,25 @@ module.exports = GetBlendModes;
*/
var BaseCamera = __webpack_require__(91);
-var CameraEvents = __webpack_require__(48);
+var CameraEvents = __webpack_require__(40);
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(29);
-var GameEvents = __webpack_require__(18);
-var IsSizePowerOfTwo = __webpack_require__(118);
+var CONST = __webpack_require__(33);
+var GameEvents = __webpack_require__(20);
+var IsSizePowerOfTwo = __webpack_require__(122);
var NOOP = __webpack_require__(1);
+var ProjectOrtho = __webpack_require__(181);
var ScaleEvents = __webpack_require__(92);
-var SpliceOne = __webpack_require__(79);
-var TextureEvents = __webpack_require__(119);
-var TransformMatrix = __webpack_require__(32);
+var SpliceOne = __webpack_require__(80);
+var TextureEvents = __webpack_require__(123);
+var TransformMatrix = __webpack_require__(30);
var Utils = __webpack_require__(10);
-var WebGLSnapshot = __webpack_require__(503);
+var WebGLSnapshot = __webpack_require__(510);
// Default Pipelines
-var BitmapMaskPipeline = __webpack_require__(504);
-var ForwardDiffuseLightPipeline = __webpack_require__(505);
-var TextureTintPipeline = __webpack_require__(235);
+var BitmapMaskPipeline = __webpack_require__(511);
+var ForwardDiffuseLightPipeline = __webpack_require__(512);
+var TextureTintPipeline = __webpack_require__(150);
+var TextureTintStripPipeline = __webpack_require__(513);
/**
* @callback WebGLContextCallback
@@ -111667,7 +115140,7 @@ var WebGLRenderer = new Class({
/**
* An array of blend modes supported by the WebGL Renderer.
- *
+ *
* This array includes the default blend modes as well as any custom blend modes added through {@link #addBlendMode}.
*
* @name Phaser.Renderer.WebGL.WebGLRenderer#blendModes
@@ -111678,7 +115151,7 @@ var WebGLRenderer = new Class({
this.blendModes = [];
/**
- * Keeps track of any WebGLTexture created with the current WebGLRenderingContext
+ * Keeps track of any WebGLTexture created with the current WebGLRenderingContext.
*
* @name Phaser.Renderer.WebGL.WebGLRenderer#nativeTextures
* @type {array}
@@ -111709,7 +115182,7 @@ var WebGLRenderer = new Class({
/**
* Details about the currently scheduled snapshot.
- *
+ *
* If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered.
*
* @name Phaser.Renderer.WebGL.WebGLRenderer#snapshotState
@@ -111733,22 +115206,73 @@ var WebGLRenderer = new Class({
// Internal Renderer State (Textures, Framebuffers, Pipelines, Buffers, etc)
/**
- * Cached value for the last texture unit that was used
+ * Cached value for the last texture unit that was used.
*
- * @name Phaser.Renderer.WebGL.WebGLRenderer#currentActiveTextureUnit
+ * @name Phaser.Renderer.WebGL.WebGLRenderer#currentActiveTexture
* @type {integer}
* @since 3.1.0
*/
- this.currentActiveTextureUnit = 0;
+ this.currentActiveTexture = 0;
/**
- * 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.
*
- * @name Phaser.Renderer.WebGL.WebGLRenderer#currentTextures
- * @type {array}
- * @since 3.0.0
+ * @name Phaser.Renderer.WebGL.WebGLRenderer#startActiveTexture
+ * @type {integer}
+ * @since 3.50.0
*/
- this.currentTextures = new Array(16);
+ this.startActiveTexture = 0;
+
+ /**
+ * 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.
+ *
+ * @name Phaser.Renderer.WebGL.WebGLRenderer#maxTextures
+ * @type {integer}
+ * @since 3.50.0
+ */
+ this.maxTextures = 0;
+
+ /**
+ * 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.
+ *
+ * @name Phaser.Renderer.WebGL.WebGLRenderer#textureIndexes
+ * @type {array}
+ * @since 3.50.0
+ */
+ this.textureIndexes;
+
+ /**
+ * An array of default temporary WebGL Textures.
+ *
+ * This array is populated during the init phase and should never be changed after boot.
+ *
+ * @name Phaser.Renderer.WebGL.WebGLRenderer#tempTextures
+ * @type {array}
+ * @since 3.50.0
+ */
+ this.tempTextures;
+
+ /**
+ * The currently bound texture at texture unit zero, if any.
+ *
+ * @name Phaser.Renderer.WebGL.WebGLRenderer#textureZero
+ * @type {?WebGLTexture}
+ * @since 3.50.0
+ */
+ this.textureZero;
+
+ /**
+ * The currently bound normal map texture at texture unit one, if any.
+ *
+ * @name Phaser.Renderer.WebGL.WebGLRenderer#normalTexture
+ * @type {?WebGLTexture}
+ * @since 3.50.0
+ */
+ this.normalTexture;
/**
* Current framebuffer in use
@@ -112019,7 +115543,7 @@ var WebGLRenderer = new Class({
/**
* Internal gl function mapping for uniform look-up.
* https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform
- *
+ *
* @name Phaser.Renderer.WebGL.WebGLRenderer#glFuncMap
* @type {any}
* @since 3.17.0
@@ -112029,7 +115553,7 @@ var WebGLRenderer = new Class({
/**
* The `type` of the Game Object being currently rendered.
* This can be used by advanced render functions for batching look-ahead.
- *
+ *
* @name Phaser.Renderer.WebGL.WebGLRenderer#currentType
* @type {string}
* @since 3.19.0
@@ -112039,7 +115563,7 @@ var WebGLRenderer = new Class({
/**
* Is the `type` of the Game Object being currently rendered different than the
* type of the object before it in the display list? I.e. it's a 'new' type.
- *
+ *
* @name Phaser.Renderer.WebGL.WebGLRenderer#newType
* @type {boolean}
* @since 3.19.0
@@ -112049,7 +115573,7 @@ var WebGLRenderer = new Class({
/**
* Does the `type` of the next Game Object in the display list match that
* of the object being currently rendered?
- *
+ *
* @name Phaser.Renderer.WebGL.WebGLRenderer#nextTypeMatch
* @type {boolean}
* @since 3.19.0
@@ -112058,30 +115582,39 @@ var WebGLRenderer = new Class({
/**
* The mipmap magFilter to be used when creating textures.
- *
+ *
* You can specify this as a string in the game config, i.e.:
- *
+ *
* `renderer: { mipmapFilter: 'NEAREST_MIPMAP_LINEAR' }`
- *
+ *
* The 6 options for WebGL1 are, in order from least to most computationally expensive:
- *
+ *
* NEAREST (for pixel art)
* LINEAR (the default)
* NEAREST_MIPMAP_NEAREST
* LINEAR_MIPMAP_NEAREST
* NEAREST_MIPMAP_LINEAR
* LINEAR_MIPMAP_LINEAR
- *
+ *
* Mipmaps only work with textures that are fully power-of-two in size.
- *
+ *
* For more details see https://webglfundamentals.org/webgl/lessons/webgl-3d-textures.html
- *
+ *
* @name Phaser.Renderer.WebGL.WebGLRenderer#mipmapFilter
* @type {GLenum}
* @since 3.21.0
*/
this.mipmapFilter = null;
+ /**
+ * The number of times the renderer had to flush this frame, due to running out of texture units.
+ *
+ * @name Phaser.Renderer.WebGL.WebGLRenderer#textureFlush
+ * @type {number}
+ * @since 3.50.0
+ */
+ this.textureFlush = 0;
+
this.init(this.config);
},
@@ -112202,16 +115735,11 @@ var WebGLRenderer = new Class({
// Load supported extensions
var exts = gl.getSupportedExtensions();
- if (!config.maxTextures)
+ if (!config.maxTextures || config.maxTextures === -1)
{
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;
@@ -112232,16 +115760,54 @@ var WebGLRenderer = new Class({
// Mipmaps
this.mipmapFilter = gl[config.mipmapFilter];
- // Initialize all textures to null
- for (var index = 0; index < this.currentTextures.length; ++index)
+ // Check maximum supported textures
+ this.maxTextures = Utils.checkShaderMax(gl, config.maxTextures);
+
+ this.textureIndexes = [];
+
+ // Create temporary WebGL textures
+ var tempTextures = this.tempTextures;
+
+ if (Array.isArray(tempTextures))
{
- this.currentTextures[index] = null;
+ for (var t = 0; i < this.maxTextures; t++)
+ {
+ gl.deleteTexture(tempTextures[t]);
+ }
}
+ else
+ {
+ tempTextures = new Array(this.maxTextures);
+ }
+
+ // Create temp textures to stop WebGL errors on mac os
+ for (var index = 0; index < this.maxTextures; index++)
+ {
+ var tempTexture = gl.createTexture();
+
+ gl.activeTexture(gl.TEXTURE0 + index);
+
+ 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 ]));
+
+ tempTextures[index] = tempTexture;
+
+ this.textureIndexes.push(index);
+ }
+
+ this.tempTextures = tempTextures;
+
+ // Reset to texture 1 (texture zero is reserved for framebuffers)
+ this.currentActiveTexture = 1;
+ this.startActiveTexture++;
+ gl.activeTexture(gl.TEXTURE1);
// Clear previous pipelines and reload default ones
this.pipelines = {};
this.addPipeline('TextureTintPipeline', new TextureTintPipeline({ game: game, renderer: this }));
+ this.addPipeline('TextureTintStripPipeline', new TextureTintStripPipeline({ game: game, renderer: this }));
this.addPipeline('BitmapMaskPipeline', new BitmapMaskPipeline({ game: game, renderer: this }));
this.addPipeline('Light2D', new ForwardDiffuseLightPipeline({ game: game, renderer: this, maxLights: config.maxLights }));
@@ -112508,7 +116074,7 @@ 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.
@@ -112581,11 +116147,11 @@ var WebGLRenderer = new Class({
*/
setPipeline: function (pipelineInstance, gameObject)
{
- if (this.currentPipeline !== pipelineInstance ||
- this.currentPipeline.vertexBuffer !== this.currentVertexBuffer ||
- this.currentPipeline.program !== this.currentProgram)
+ var current = this.currentPipeline;
+
+ if (current !== pipelineInstance || current.vertexBuffer !== this.currentVertexBuffer || current.program !== this.currentProgram)
{
- this.flush();
+ this.resetTextures();
this.currentPipeline = pipelineInstance;
this.currentPipeline.bind();
}
@@ -112600,7 +116166,7 @@ var WebGLRenderer = new Class({
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#hasActiveStencilMask
* @since 3.17.0
- *
+ *
* @return {boolean} `true` if there is an active stencil mask, otherwise `false`.
*/
hasActiveStencilMask: function ()
@@ -112614,20 +116180,20 @@ var WebGLRenderer = new Class({
/**
* 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.
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#rebindPipeline
* @since 3.16.0
- *
+ *
* @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - The pipeline instance to be activated.
*/
rebindPipeline: function (pipelineInstance)
@@ -112652,11 +116218,13 @@ var WebGLRenderer = new Class({
this.setBlendMode(0, true);
- gl.activeTexture(gl.TEXTURE0);
- gl.bindTexture(gl.TEXTURE_2D, this.blankTexture.glTexture);
+ this.resetTextures(true);
- this.currentActiveTextureUnit = 0;
- this.currentTextures[0] = this.blankTexture.glTexture;
+ // gl.activeTexture(gl.TEXTURE1);
+ // gl.bindTexture(gl.TEXTURE_2D, this.blankTexture.glTexture);
+
+ this.currentActiveTexture = 1;
+ this.startActiveTexture++;
this.currentPipeline = pipelineInstance;
this.currentPipeline.bind();
@@ -112731,7 +116299,7 @@ var WebGLRenderer = new Class({
/**
* Creates a new custom blend mode for the renderer.
- *
+ *
* See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Blending_modes
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode
@@ -112804,17 +116372,226 @@ var WebGLRenderer = new Class({
* @method Phaser.Renderer.WebGL.WebGLRenderer#setBlankTexture
* @private
* @since 3.12.0
- *
- * @param {boolean} [force=false] - Force a blank texture set, regardless of what's already bound?
*/
- setBlankTexture: function (force)
+ setBlankTexture: function ()
{
- if (force === undefined) { force = false; }
+ this.setTexture2D(this.blankTexture.glTexture);
+ },
- if (force || this.currentActiveTextureUnit !== 0 || !this.currentTextures[0])
+ /**
+ * Activates the Texture Source and assigns it the next available texture unit.
+ * If none are available, it will flush the current pipeline first.
+ *
+ * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureSource
+ * @since 3.50.0
+ *
+ * @param {Phaser.Textures.TextureSource} textureSource - The Texture Source to be assigned the texture unit.
+ *
+ * @return {number} The texture unit that was assigned to the Texture Source.
+ */
+ setTextureSource: function (textureSource)
+ {
+ var gl = this.gl;
+ var currentActiveTexture = this.currentActiveTexture;
+
+ if (textureSource.glIndexCounter < this.startActiveTexture)
{
- this.setTexture2D(this.blankTexture.glTexture, 0);
+ textureSource.glIndexCounter = this.startActiveTexture;
+
+ if (currentActiveTexture < this.maxTextures)
+ {
+ textureSource.glIndex = currentActiveTexture;
+
+ gl.activeTexture(gl.TEXTURE0 + currentActiveTexture);
+ gl.bindTexture(gl.TEXTURE_2D, textureSource.glTexture);
+
+ this.currentActiveTexture++;
+ }
+ else
+ {
+ // We're out of textures, so flush the batch and reset back to 0
+ this.flush();
+
+ this.startActiveTexture++;
+
+ this.textureFlush++;
+
+ textureSource.glIndexCounter = this.startActiveTexture;
+
+ textureSource.glIndex = 1;
+
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_2D, textureSource.glTexture);
+
+ this.currentActiveTexture = 2;
+ }
}
+
+ return textureSource.glIndex;
+ },
+
+ /**
+ * Checks to see if the given diffuse and normal map textures are already bound, or not.
+ *
+ * @method Phaser.Renderer.WebGL.WebGLRenderer#isNewNormalMap
+ * @since 3.50.0
+ *
+ * @param {WebGLTexture} texture - The WebGL diffuse texture.
+ * @param {WebGLTexture} normalMap - The WebGL normal map texture.
+ *
+ * @return {boolean} Returns `false` if this combination is already set, or `true` if it's a new combination.
+ */
+ isNewNormalMap: function (texture, normalMap)
+ {
+ return (this.textureZero !== texture || this.normalTexture !== normalMap);
+ },
+
+ /**
+ * 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.
+ *
+ * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureZero
+ * @since 3.50.0
+ *
+ * @param {WebGLTexture} texture - The WebGL texture that needs to be bound.
+ */
+ setTextureZero: function (texture)
+ {
+ if (this.textureZero !== texture)
+ {
+ var gl = this.gl;
+
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ this.textureZero = texture;
+ }
+ },
+
+ /**
+ * Clears the texture that was directly bound to texture unit zero.
+ *
+ * @method Phaser.Renderer.WebGL.WebGLRenderer#clearTextureZero
+ * @since 3.50.0
+ */
+ clearTextureZero: function ()
+ {
+ this.textureZero = null;
+ },
+
+ /**
+ * 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.
+ *
+ * @method Phaser.Renderer.WebGL.WebGLRenderer#setNormalMap
+ * @since 3.50.0
+ *
+ * @param {WebGLTexture} texture - The WebGL texture that needs to be bound.
+ */
+ setNormalMap: function (texture)
+ {
+ if (this.normalTexture !== texture)
+ {
+ var gl = this.gl;
+
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ this.normalTexture = texture;
+
+ if (this.currentActiveTexture === 1)
+ {
+ this.currentActiveTexture = 2;
+ }
+ }
+ },
+
+ /**
+ * Clears the texture that was directly bound to texture unit one and
+ * increases the start active texture counter.
+ *
+ * @method Phaser.Renderer.WebGL.WebGLRenderer#clearNormalMap
+ * @since 3.50.0
+ */
+ clearNormalMap: function ()
+ {
+ this.normalTexture = null;
+ this.startActiveTexture++;
+ this.currentActiveTexture = 1;
+
+ this.textureFlush++;
+ },
+
+ /**
+ * Activates each texture, in turn, then binds them all to `null`.
+ *
+ * @method Phaser.Renderer.WebGL.WebGLRenderer#unbindTextures
+ * @since 3.50.0
+ *
+ * @param {boolean} [all=false] - Reset all textures, or just the first two?
+ */
+ unbindTextures: function ()
+ {
+ var gl = this.gl;
+ var temp = this.tempTextures;
+
+ for (var i = 0; i < temp.length; i++)
+ {
+ gl.activeTexture(gl.TEXTURE0 + i);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ }
+
+ this.normalTexture = null;
+ this.textureZero = null;
+
+ this.currentActiveTexture = 1;
+ this.startActiveTexture++;
+
+ this.textureFlush++;
+ },
+
+ /**
+ * 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.
+ *
+ * @method Phaser.Renderer.WebGL.WebGLRenderer#resetTextures
+ * @since 3.50.0
+ *
+ * @param {boolean} [all=false] - Reset all textures, or just the first two?
+ */
+ resetTextures: function (all)
+ {
+ if (all === undefined) { all = false; }
+
+ this.flush();
+
+ 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)
+ {
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_2D, temp[1]);
+ }
+
+ this.normalTexture = null;
+ this.textureZero = null;
+
+ this.currentActiveTexture = 1;
+ this.startActiveTexture++;
+
+ this.textureFlush++;
},
/**
@@ -112823,39 +116600,51 @@ var WebGLRenderer = new Class({
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#setTexture2D
* @since 3.0.0
+ * @version 2.0 - Updated in 3.50.0 to remove the `textureUnit` and `flush` parameters.
*
* @param {WebGLTexture} texture - The WebGL texture that needs to be bound.
- * @param {integer} textureUnit - The texture unit to which the texture will be bound.
- * @param {boolean} [flush=true] - Will the current pipeline be flushed if this is a new texture, or not?
*
- * @return {this} This WebGLRenderer instance.
+ * @return {number} The texture unit that was assigned to the Texture Source.
*/
- setTexture2D: function (texture, textureUnit, flush)
+ setTexture2D: function (texture)
{
- if (flush === undefined) { flush = true; }
-
var gl = this.gl;
+ var currentActiveTexture = this.currentActiveTexture;
- if (texture !== this.currentTextures[textureUnit])
+ if (texture.glIndexCounter < this.startActiveTexture)
{
- if (flush)
+ texture.glIndexCounter = this.startActiveTexture;
+
+ if (currentActiveTexture < this.maxTextures)
{
+ texture.glIndex = currentActiveTexture;
+
+ gl.activeTexture(gl.TEXTURE0 + currentActiveTexture);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ this.currentActiveTexture++;
+ }
+ else
+ {
+ // We're out of textures, so flush the batch and reset back to 1 (0 is reserved for fbos)
this.flush();
+
+ this.startActiveTexture++;
+
+ this.textureFlush++;
+
+ texture.glIndexCounter = this.startActiveTexture;
+
+ texture.glIndex = 1;
+
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ this.currentActiveTexture = 2;
}
-
- if (this.currentActiveTextureUnit !== textureUnit)
- {
- gl.activeTexture(gl.TEXTURE0 + textureUnit);
-
- this.currentActiveTextureUnit = textureUnit;
- }
-
- gl.bindTexture(gl.TEXTURE_2D, texture);
-
- this.currentTextures[textureUnit] = texture;
}
- return this;
+ return texture.glIndex;
},
/**
@@ -113073,7 +116862,11 @@ var WebGLRenderer = new Class({
var gl = this.gl;
var texture = gl.createTexture();
- this.setTexture2D(texture, 0);
+ gl.activeTexture(gl.TEXTURE0);
+
+ var currentTexture = gl.getParameter(gl.TEXTURE_BINDING_2D);
+
+ gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);
@@ -113103,12 +116896,17 @@ var WebGLRenderer = new Class({
gl.generateMipmap(gl.TEXTURE_2D);
}
- this.setTexture2D(null, 0);
+ if (currentTexture)
+ {
+ gl.bindTexture(gl.TEXTURE_2D, currentTexture);
+ }
texture.isAlphaPremultiplied = pma;
texture.isRenderTexture = false;
texture.width = width;
texture.height = height;
+ texture.glIndex = 0;
+ texture.glIndexCounter = -1;
this.nativeTextures.push(texture);
@@ -113167,6 +116965,8 @@ var WebGLRenderer = new Class({
this.setFramebuffer(null);
+ this.resetTextures(true);
+
return framebuffer;
},
@@ -113285,11 +117085,15 @@ var WebGLRenderer = new Class({
this.gl.deleteTexture(texture);
- if (this.currentTextures[0] === texture && !this.game.pendingDestroy)
+ this.resetTextures();
+
+ /*
+ if (!this.game.pendingDestroy)
{
// texture we just deleted is in use, so bind a blank texture
this.setBlankTexture(true);
}
+ */
return this;
},
@@ -113379,7 +117183,7 @@ var WebGLRenderer = new Class({
gl.clear(gl.COLOR_BUFFER_BIT);
- TextureTintPipeline.projOrtho(cx, cw + cx, cy, ch + cy, -1000, 1000);
+ ProjectOrtho(TextureTintPipeline, cx, cw + cx, cy, ch + cy, -1000, 1000);
if (camera.mask)
{
@@ -113397,7 +117201,7 @@ var WebGLRenderer = new Class({
color.alphaGL
);
}
-
+
camera.emit(CameraEvents.PRE_RENDER, camera);
}
else
@@ -113423,6 +117227,13 @@ var WebGLRenderer = new Class({
}
},
+ /**
+ * Return the current stencil mask.
+ *
+ * @method Phaser.Renderer.WebGL.WebGLRenderer#getCurrentStencilMask
+ * @private
+ * @since 3.50.0
+ */
getCurrentStencilMask: function ()
{
var prev = null;
@@ -113452,6 +117263,8 @@ var WebGLRenderer = new Class({
*/
postRenderCamera: function (camera)
{
+ this.setPipeline(this.pipelines.TextureTintPipeline);
+
var TextureTintPipeline = this.pipelines.TextureTintPipeline;
camera.flashEffect.postRenderWebGL(TextureTintPipeline, Utils.getTintFromFloats);
@@ -113469,33 +117282,36 @@ var WebGLRenderer = new Class({
camera.emit(CameraEvents.POST_RENDER, camera);
- TextureTintPipeline.projOrtho(0, TextureTintPipeline.width, TextureTintPipeline.height, 0, -1000.0, 1000.0);
+ if (camera.renderToGame)
+ {
+ ProjectOrtho(TextureTintPipeline, 0, TextureTintPipeline.width, TextureTintPipeline.height, 0, -1000.0, 1000.0);
- var getTint = Utils.getTintAppendFloatAlpha;
+ var getTint = Utils.getTintAppendFloatAlpha;
- var pipeline = (camera.pipeline) ? camera.pipeline : TextureTintPipeline;
+ var pipeline = (camera.pipeline) ? camera.pipeline : TextureTintPipeline;
- pipeline.batchTexture(
- camera,
- camera.glTexture,
- camera.width, camera.height,
- camera.x, camera.y,
- camera.width, camera.height,
- camera.zoom, camera.zoom,
- camera.rotation,
- 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
- );
+ pipeline.batchTexture(
+ camera,
+ camera.glTexture,
+ camera.width, camera.height,
+ camera.x, camera.y,
+ camera.width, camera.height,
+ camera.zoom, camera.zoom,
+ camera.rotation,
+ 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);
@@ -113556,17 +117372,19 @@ var WebGLRenderer = new Class({
this.currentCameraMask.mask = null;
this.maskStack.length = 0;
+ this.textureFlush = 0;
+
this.setPipeline(this.pipelines.TextureTintPipeline);
},
/**
* The core render step for a Scene Camera.
- *
+ *
* Iterates through the given Game Object's array 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.WebGL.WebGLRenderer#render
@@ -113606,7 +117424,7 @@ var WebGLRenderer = new Class({
// Reset the current type
this.currentType = '';
-
+
var current = this.currentMask;
for (var i = 0; i < childCount; i++)
@@ -113696,16 +117514,22 @@ var WebGLRenderer = new Class({
{
pipelines[key].onPostRender();
}
+
+ if (this.textureFlush > 0)
+ {
+ this.startActiveTexture++;
+ this.currentActiveTexture = 1;
+ }
},
/**
* Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered.
- *
+ *
* To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`.
- *
+ *
* Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then
* calling this method will override it.
- *
+ *
* Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView.
* It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it,
* which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process,
@@ -113727,12 +117551,12 @@ var WebGLRenderer = new Class({
/**
* Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered.
- *
+ *
* To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`.
- *
+ *
* Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then
* calling this method will override it.
- *
+ *
* Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView.
* It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it,
* which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process,
@@ -113769,12 +117593,12 @@ var WebGLRenderer = new Class({
/**
* Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered.
- *
+ *
* To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`.
- *
+ *
* Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then
* calling this method will override it.
- *
+ *
* Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for
* the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute,
* using less memory.
@@ -113799,9 +117623,9 @@ var WebGLRenderer = new Class({
/**
* Takes a snapshot of the given area of the given frame buffer.
- *
+ *
* Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render.
- *
+ *
* Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView.
* It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it,
* which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process,
@@ -113858,17 +117682,17 @@ var WebGLRenderer = new Class({
/**
* Creates a new WebGL Texture based on the given Canvas Element.
- *
+ *
* If the `dstTexture` parameter is given, the WebGL Texture is updated, rather than created fresh.
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#canvasToTexture
* @since 3.0.0
- *
+ *
* @param {HTMLCanvasElement} srcCanvas - The Canvas to create the WebGL Texture from
* @param {WebGLTexture} [dstTexture] - The destination WebGL Texture to set.
* @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT` (such as for Text objects?)
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
- *
+ *
* @return {WebGLTexture} The newly created, or updated, WebGL Texture.
*/
canvasToTexture: function (srcCanvas, dstTexture, noRepeat, flipY)
@@ -113891,11 +117715,11 @@ var WebGLRenderer = new Class({
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#createCanvasTexture
* @since 3.20.0
- *
+ *
* @param {HTMLCanvasElement} srcCanvas - The Canvas to create the WebGL Texture from
* @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT` (such as for Text objects?)
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
- *
+ *
* @return {WebGLTexture} The newly created WebGL Texture.
*/
createCanvasTexture: function (srcCanvas, noRepeat, flipY)
@@ -113933,11 +117757,11 @@ var WebGLRenderer = new Class({
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#updateCanvasTexture
* @since 3.20.0
- *
+ *
* @param {HTMLCanvasElement} srcCanvas - The Canvas to update the WebGL Texture from.
* @param {WebGLTexture} dstTexture - The destination WebGL Texture to update.
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
- *
+ *
* @return {WebGLTexture} The updated WebGL Texture.
*/
updateCanvasTexture: function (srcCanvas, dstTexture, flipY)
@@ -113951,16 +117775,21 @@ var WebGLRenderer = new Class({
if (width > 0 && height > 0)
{
- this.setTexture2D(dstTexture, 0);
+ gl.activeTexture(gl.TEXTURE0);
+ var currentTexture = gl.getParameter(gl.TEXTURE_BINDING_2D);
+ gl.bindTexture(gl.TEXTURE_2D, dstTexture);
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, srcCanvas);
-
+
dstTexture.width = width;
dstTexture.height = height;
-
- this.setTexture2D(null, 0);
+
+ if (currentTexture)
+ {
+ gl.bindTexture(gl.TEXTURE_2D, currentTexture);
+ }
}
return dstTexture;
@@ -113971,11 +117800,11 @@ var WebGLRenderer = new Class({
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#createVideoTexture
* @since 3.20.0
- *
+ *
* @param {HTMLVideoElement} srcVideo - The Video to create the WebGL Texture from
* @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT`?
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
- *
+ *
* @return {WebGLTexture} The newly created WebGL Texture.
*/
createVideoTexture: function (srcVideo, noRepeat, flipY)
@@ -114013,11 +117842,11 @@ var WebGLRenderer = new Class({
*
* @method Phaser.Renderer.WebGL.WebGLRenderer#updateVideoTexture
* @since 3.20.0
- *
+ *
* @param {HTMLVideoElement} srcVideo - The Video to update the WebGL Texture with.
* @param {WebGLTexture} dstTexture - The destination WebGL Texture to update.
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
- *
+ *
* @return {WebGLTexture} The updated WebGL Texture.
*/
updateVideoTexture: function (srcVideo, dstTexture, flipY)
@@ -114031,7 +117860,9 @@ var WebGLRenderer = new Class({
if (width > 0 && height > 0)
{
- this.setTexture2D(dstTexture, 0);
+ gl.activeTexture(gl.TEXTURE0);
+ var currentTexture = gl.getParameter(gl.TEXTURE_BINDING_2D);
+ gl.bindTexture(gl.TEXTURE_2D, dstTexture);
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
@@ -114040,7 +117871,10 @@ var WebGLRenderer = new Class({
dstTexture.width = width;
dstTexture.height = height;
- this.setTexture2D(null, 0);
+ if (currentTexture)
+ {
+ gl.bindTexture(gl.TEXTURE_2D, currentTexture);
+ }
}
return dstTexture;
@@ -114062,25 +117896,36 @@ var WebGLRenderer = new Class({
var gl = this.gl;
var glFilter = [ gl.LINEAR, gl.NEAREST ][filter];
- this.setTexture2D(texture, 0);
+ // this.setTexture2D(texture, 0);
+ gl.activeTexture(gl.TEXTURE0);
+
+ var currentTexture = gl.getParameter(gl.TEXTURE_BINDING_2D);
+
+ gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, glFilter);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, glFilter);
- this.setTexture2D(null, 0);
+ // this.setTexture2D(null, 0);
+ if (currentTexture)
+ {
+ gl.bindTexture(gl.TEXTURE_2D, currentTexture);
+ }
return this;
},
/**
- * [description]
+ * 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 - [description]
+ * @param {number} x - The 1f value to set on the named uniform.
*
* @return {this} This WebGL Renderer instance.
*/
@@ -114094,15 +117939,17 @@ var WebGLRenderer = new Class({
},
/**
- * [description]
+ * 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 - [description]
- * @param {number} y - [description]
+ * @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.
*/
@@ -114116,16 +117963,18 @@ var WebGLRenderer = new Class({
},
/**
- * [description]
+ * 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 - [description]
- * @param {number} y - [description]
- * @param {number} z - [description]
+ * @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.
*/
@@ -114139,17 +117988,19 @@ var WebGLRenderer = new Class({
},
/**
- * Sets uniform of a WebGLProgram
+ * 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 - X component
- * @param {number} y - Y component
- * @param {number} z - Z component
- * @param {number} w - W component
+ * @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.
*/
@@ -114163,7 +118014,9 @@ var WebGLRenderer = new Class({
},
/**
- * Sets the value of a uniform variable in the given WebGLProgram.
+ * 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
@@ -114184,7 +118037,9 @@ var WebGLRenderer = new Class({
},
/**
- * Sets the value of a uniform variable in the given WebGLProgram.
+ * 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
@@ -114205,7 +118060,9 @@ var WebGLRenderer = new Class({
},
/**
- * Sets the value of a uniform variable in the given WebGLProgram.
+ * 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
@@ -114226,7 +118083,9 @@ var WebGLRenderer = new Class({
},
/**
- * Sets the value of a uniform variable in the given WebGLProgram.
+ * 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
@@ -114248,14 +118107,39 @@ var WebGLRenderer = new Class({
},
/**
- * Sets the value of a uniform variable in the given WebGLProgram.
+ * 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 - [description]
+ * @param {integer} x - The 1i value to set on the named uniform.
*
* @return {this} This WebGL Renderer instance.
*/
@@ -114269,15 +118153,17 @@ var WebGLRenderer = new Class({
},
/**
- * Sets the value of a uniform variable in the given WebGLProgram.
+ * 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 new X component
- * @param {integer} y - The new Y component
+ * @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.
*/
@@ -114291,16 +118177,18 @@ var WebGLRenderer = new Class({
},
/**
- * Sets the value of a uniform variable in the given WebGLProgram.
+ * 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 new X component
- * @param {integer} y - The new Y component
- * @param {integer} z - The new Z component
+ * @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.
*/
@@ -114314,17 +118202,19 @@ var WebGLRenderer = new Class({
},
/**
- * Sets the value of a uniform variable in the given WebGLProgram.
+ * 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 - X component
- * @param {integer} y - Y component
- * @param {integer} z - Z component
- * @param {integer} w - W component
+ * @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.
*/
@@ -114338,7 +118228,9 @@ var WebGLRenderer = new Class({
},
/**
- * Sets the value of a 2x2 matrix uniform variable in the given WebGLProgram.
+ * 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
@@ -114346,7 +118238,7 @@ var WebGLRenderer = new Class({
* @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 - The new matrix value.
+ * @param {Float32Array} matrix - A Float32Array or sequence of 4 float values.
*
* @return {this} This WebGL Renderer instance.
*/
@@ -114360,15 +118252,17 @@ var WebGLRenderer = new Class({
},
/**
- * [description]
+ * 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 - [description]
- * @param {Float32Array} matrix - [description]
+ * @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.
*/
@@ -114382,15 +118276,17 @@ var WebGLRenderer = new Class({
},
/**
- * Sets uniform of a WebGLProgram
+ * 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 - Is the matrix transposed
- * @param {Float32Array} matrix - Matrix data
+ * @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.
*/
@@ -114441,11 +118337,23 @@ var WebGLRenderer = new Class({
{
// Clear-up anything that should be cleared :)
- for (var i = 0; i < this.nativeTextures.length; i++)
+ var i;
+ var gl = this.gl;
+
+ var temp = this.tempTextures;
+ var native = this.nativeTextures;
+
+ for (i = 0; i < temp.length; i++)
{
- this.gl.deleteTexture(this.nativeTextures[i]);
+ gl.deleteTexture(temp[i]);
}
+ for (i = 0; i < native.length; i++)
+ {
+ gl.deleteTexture(native[i]);
+ }
+
+ this.textureIndexes = [];
this.nativeTextures = [];
for (var key in this.pipelines)
@@ -114480,7 +118388,7 @@ module.exports = WebGLRenderer;
/***/ }),
-/* 503 */
+/* 510 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -114490,7 +118398,7 @@ module.exports = WebGLRenderer;
*/
var CanvasPool = __webpack_require__(26);
-var Color = __webpack_require__(33);
+var Color = __webpack_require__(31);
var GetFastValue = __webpack_require__(2);
/**
@@ -114590,7 +118498,7 @@ module.exports = WebGLSnapshot;
/***/ }),
-/* 504 */
+/* 511 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -114601,9 +118509,9 @@ module.exports = WebGLSnapshot;
*/
var Class = __webpack_require__(0);
-var ShaderSourceFS = __webpack_require__(776);
-var ShaderSourceVS = __webpack_require__(777);
-var WebGLPipeline = __webpack_require__(234);
+var ShaderSourceFS = __webpack_require__(787);
+var ShaderSourceVS = __webpack_require__(788);
+var WebGLPipeline = __webpack_require__(149);
/**
* @classdesc
@@ -114721,21 +118629,23 @@ var BitmapMaskPipeline = new Class({
},
/**
- * [description]
+ * Resizes this pipeline and updates the projection.
*
* @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#resize
* @since 3.0.0
*
- * @param {number} width - [description]
- * @param {number} height - [description]
- * @param {number} resolution - [description]
+ * @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);
+
this.resolutionDirty = true;
+
return this;
},
@@ -114748,7 +118658,7 @@ var BitmapMaskPipeline = new Class({
*
* @param {Phaser.GameObjects.GameObject} mask - GameObject used as mask.
* @param {Phaser.GameObjects.GameObject} maskedObject - GameObject masked by the mask GameObject.
- * @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
+ * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera rendering the current mask.
*/
beginMask: function (mask, maskedObject, camera)
{
@@ -114853,7 +118763,7 @@ module.exports = BitmapMaskPipeline;
/***/ }),
-/* 505 */
+/* 512 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -114864,16 +118774,20 @@ module.exports = BitmapMaskPipeline;
*/
var Class = __webpack_require__(0);
-var ShaderSourceFS = __webpack_require__(778);
-var TextureTintPipeline = __webpack_require__(235);
+var ShaderSourceFS = __webpack_require__(789);
+var TextureTintPipeline = __webpack_require__(150);
+var WebGLPipeline = __webpack_require__(149);
var LIGHT_COUNT = 10;
/**
* @classdesc
* ForwardDiffuseLightPipeline implements a forward rendering approach for 2D lights.
- * This pipeline extends TextureTintPipeline so it implements all it's rendering functions
- * and batching system.
+ *
+ * It works by using a custom shader, combined with Light Game Objects, that provides an ambient
+ * illumination effect in your games.
+ *
+ * This pipeline extends TextureTintPipeline so it implements all of its rendering functions and batching system.
*
* @class ForwardDiffuseLightPipeline
* @extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline
@@ -114897,16 +118811,6 @@ var ForwardDiffuseLightPipeline = new Class({
TextureTintPipeline.call(this, config);
- /**
- * Default normal map texture to use.
- *
- * @name Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#defaultNormalMap
- * @type {Phaser.Texture.Frame}
- * @private
- * @since 3.11.0
- */
- this.defaultNormalMap;
-
/**
* Inverse rotation matrix for normal map rotations.
*
@@ -114920,51 +118824,78 @@ var ForwardDiffuseLightPipeline = new Class({
0, 1, 0,
0, 0, 1
]);
+
+ /**
+ * 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.
+ *
+ * @name Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#defaultNormalMap
+ * @type {object}
+ * @since 3.50.0
+ */
+ this.defaultNormalMap;
+
+ /**
+ * Stores the previous number of lights rendered.
+ *
+ * @name Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#lightCount
+ * @type {number}
+ * @since 3.50.0
+ */
+ this.lightCount = 0;
+
+ this.forceZero = true;
},
/**
* 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.Pipelines.ForwardDiffuseLightPipeline#boot
- * @override
+ * @method Phaser.Renderer.WebGL.ForwardDiffuseLightPipeline#boot
* @since 3.11.0
*/
boot: function ()
{
- this.defaultNormalMap = this.game.textures.getFrame('__DEFAULT');
+ WebGLPipeline.prototype.boot.call(this);
+
+ var gl = this.gl;
+
+ var tempTexture = gl.createTexture();
+
+ gl.activeTexture(gl.TEXTURE0);
+
+ gl.bindTexture(gl.TEXTURE_2D, tempTexture);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([ 127, 127, 255, 255 ]));
+
+ this.defaultNormalMap = { glTexture: tempTexture };
+
+ return this;
},
/**
- * This function binds its base class resources and this lights 2D resources.
+ * 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.ForwardDiffuseLightPipeline#onBind
- * @override
- * @since 3.0.0
- *
- * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any.
+ * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#bind
+ * @since 3.50.0
*
* @return {this} This WebGLPipeline instance.
*/
- onBind: function (gameObject)
+ bind: function ()
{
- TextureTintPipeline.prototype.onBind.call(this);
+ WebGLPipeline.prototype.bind.call(this);
var renderer = this.renderer;
var program = this.program;
- this.mvpUpdate();
-
+ renderer.setInt1(program, 'uMainSampler', 0);
renderer.setInt1(program, 'uNormSampler', 1);
renderer.setFloat2(program, 'uResolution', this.width, this.height);
- if (gameObject)
- {
- this.setNormalMap(gameObject);
- }
-
return this;
},
@@ -115006,28 +118937,44 @@ var ForwardDiffuseLightPipeline = new Class({
var cameraMatrix = camera.matrix;
var point = {x: 0, y: 0};
var height = renderer.height;
- var index;
+ var i;
- for (index = 0; index < LIGHT_COUNT; ++index)
+ if (lightCount !== this.lightCount)
{
- // Reset lights
- renderer.setFloat1(program, 'uLights[' + index + '].radius', 0);
+ for (i = 0; i < LIGHT_COUNT; i++)
+ {
+ // Reset lights
+ renderer.setFloat1(program, 'uLights[' + i + '].radius', 0);
+ }
+
+ this.lightCount = lightCount;
}
- renderer.setFloat4(program, 'uCamera', camera.x, camera.y, camera.rotation, camera.zoom);
+ 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 (index = 0; index < lightCount; ++index)
+ for (i = 0; i < lightCount; i++)
{
- var light = lights[index];
- var lightName = 'uLights[' + index + '].';
+ var light = lights[i];
+ var lightName = 'uLights[' + i + '].';
cameraMatrix.transformPoint(light.x, light.y, point);
+ // 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));
- 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);
+
+ 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.currentNormalMapRotation = null;
@@ -115035,279 +118982,20 @@ var ForwardDiffuseLightPipeline = new Class({
return this;
},
- /**
- * Generic function for batching a textured quad
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#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 (0 for additive, 1 for replacement)
- * @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
- */
- 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)
- {
- if (!this.active)
- {
- return;
- }
-
- this.renderer.setPipeline(this);
-
- var normalTexture;
-
- if (gameObject.displayTexture)
- {
- normalTexture = gameObject.displayTexture.dataSource[gameObject.displayFrame.sourceIndex];
- }
- else if (gameObject.texture)
- {
- normalTexture = gameObject.texture.dataSource[gameObject.frame.sourceIndex];
- }
- else if (gameObject.tileset)
- {
- if (Array.isArray(gameObject.tileset))
- {
- normalTexture = gameObject.tileset[0].image.dataSource[0];
- }
- else
- {
- normalTexture = gameObject.tileset.image.dataSource[0];
- }
- }
-
- if (!normalTexture)
- {
- console.warn('Normal map missing or invalid');
- return;
- }
-
- this.setTexture2D(normalTexture.glTexture, 1);
- this.setNormalMapRotation(rotation);
-
- 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 + frameX;
- // var y = -displayOriginY + frameY;
-
- 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 ^ (texture.isRenderTexture ? 1 : 0);
-
- if (flipX)
- {
- width *= -1;
- x += srcWidth;
- }
-
- if (flipY)
- {
- height *= -1;
- y += srcHeight;
- }
-
- // Do we need this? (doubt it)
- // if (camera.roundPixels)
- // {
- // x |= 0;
- // y |= 0;
- // }
-
- 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);
- }
-
- this.setTexture2D(texture, 0);
-
- this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0);
- },
-
- /**
- * Sets the Game Objects normal map as the active texture.
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#setNormalMap
- * @since 3.11.0
- *
- * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to update.
- */
- setNormalMap: function (gameObject)
- {
- if (!this.active || !gameObject)
- {
- return;
- }
-
- var normalTexture;
-
- if (gameObject.texture)
- {
- normalTexture = gameObject.texture.dataSource[gameObject.frame.sourceIndex];
- }
-
- if (!normalTexture)
- {
- normalTexture = this.defaultNormalMap;
- }
-
- this.setTexture2D(normalTexture.glTexture, 1);
-
- this.renderer.setPipeline(gameObject.defaultPipeline);
- },
-
/**
* Rotates the normal map vectors inversely by the given angle.
* Only works in 2D space.
- *
+ *
* @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#setNormalMapRotation
* @since 3.16.0
- *
+ *
* @param {number} rotation - The angle of rotation in radians.
*/
setNormalMapRotation: function (rotation)
{
- if (rotation !== this.currentNormalMapRotation || this.batches.length === 0)
+ if (rotation !== this.currentNormalMapRotation || this.vertexCount === 0)
{
- if (this.batches.length > 0)
+ if (this.vertexCount > 0)
{
this.flush();
}
@@ -115337,33 +119025,119 @@ var ForwardDiffuseLightPipeline = new Class({
},
/**
- * Takes a Sprite Game Object, or any object that extends it, which has a normal texture and adds it to the batch.
+ * 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.ForwardDiffuseLightPipeline#batchSprite
- * @since 3.0.0
+ * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#setTexture2D
+ * @since 3.50.0
*
- * @param {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.
+ * @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.
*/
- batchSprite: function (sprite, camera, parentTransformMatrix)
+ setTexture2D: function (texture, gameObject)
{
- if (!this.active)
+ var renderer = this.renderer;
+
+ if (texture === undefined) { texture = renderer.tempTextures[0]; }
+
+ var normalTexture = this.getNormalMap(gameObject);
+
+ if (renderer.isNewNormalMap())
{
- return;
+ this.flush();
+
+ renderer.setTextureZero(texture);
+ renderer.setNormalMap(normalTexture);
}
- var normalTexture = sprite.texture.dataSource[sprite.frame.sourceIndex];
+ var rotation = (gameObject) ? gameObject.rotation : 0;
- if (normalTexture)
+ this.setNormalMapRotation(rotation);
+
+ this.currentUnit = 0;
+
+ 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.ForwardDiffuseLightPipeline#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; }
+
+ var renderer = this.renderer;
+ var texture = frame.glTexture;
+ var normalTexture = this.getNormalMap(gameObject);
+
+ if (renderer.isNewNormalMap())
{
- this.renderer.setPipeline(this);
+ this.flush();
- this.setTexture2D(normalTexture.glTexture, 1);
- this.setNormalMapRotation(sprite.rotation);
-
- TextureTintPipeline.prototype.batchSprite.call(this, sprite, camera, parentTransformMatrix);
+ renderer.setTextureZero(texture);
+ renderer.setNormalMap(normalTexture);
}
+
+ this.setNormalMapRotation(gameObject.rotation);
+
+ this.currentUnit = 0;
+
+ return 0;
+ },
+
+ /**
+ * 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.
+ *
+ * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#getNormalMap
+ * @since 3.50.0
+ *
+ * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object to get the normal map from.
+ *
+ * @return {WebGLTexture} The normal map texture.
+ */
+ getNormalMap: function (gameObject)
+ {
+ var normalTexture;
+
+ if (!gameObject)
+ {
+ normalTexture = this.defaultNormalMap;
+ }
+ else if (gameObject.displayTexture)
+ {
+ normalTexture = gameObject.displayTexture.dataSource[gameObject.displayFrame.sourceIndex];
+ }
+ else if (gameObject.texture)
+ {
+ normalTexture = gameObject.texture.dataSource[gameObject.frame.sourceIndex];
+ }
+ else if (gameObject.tileset)
+ {
+ if (Array.isArray(gameObject.tileset))
+ {
+ normalTexture = gameObject.tileset[0].image.dataSource[0];
+ }
+ else
+ {
+ normalTexture = gameObject.tileset.image.dataSource[0];
+ }
+ }
+
+ if (!normalTexture)
+ {
+ normalTexture = this.defaultNormalMap;
+ }
+
+ return normalTexture.glTexture;
}
});
@@ -115374,761 +119148,60 @@ module.exports = ForwardDiffuseLightPipeline;
/***/ }),
-/* 506 */
-/***/ (function(module, exports) {
+/* 513 */
+/***/ (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 ModelViewProjection = __webpack_require__(151);
+var TextureTintPipeline = __webpack_require__(150);
+
/**
- * Implements a model view projection matrices.
- * Pipelines can implement this for doing 2D and 3D rendering.
+ * @classdesc
+ * The Texture Tint Strip Pipeline is a variation of the Texture Tint Pipeline that uses a TRIANGLE_STRIP for
+ * its topology, instead of TRIANGLES. This is primarily used by the Rope Game Object any anything that extends it.
*
- * @namespace Phaser.Renderer.WebGL.Pipelines.ModelViewProjection
- * @since 3.0.0
+ * @class TextureTintStripPipeline
+ * @extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline
+ * @memberof Phaser.Renderer.WebGL.Pipelines
+ * @constructor
+ * @since 3.23.0
+ *
+ * @param {object} config - The configuration options for this Texture Tint Pipeline, as described above.
*/
-var ModelViewProjection = {
+var TextureTintStripPipeline = new Class({
- /**
- * 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,
+ Extends: TextureTintPipeline,
- /**
- * 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,
+ Mixins: [
+ ModelViewProjection
+ ],
- /**
- * 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,
+ initialize:
- /**
- * 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 ()
+ function TextureTintStripPipeline (config)
{
- 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;
- },
+ config.topology = config.renderer.gl.TRIANGLE_STRIP;
- /**
- * 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;
- },
-
- /**
- * Loads an identity matrix to the model matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelIdentity
- * @since 3.0.0
- */
- modelIdentity: function ()
- {
- var modelMatrix = this.modelMatrix;
-
- modelMatrix[0] = 1;
- modelMatrix[1] = 0;
- modelMatrix[2] = 0;
- modelMatrix[3] = 0;
- modelMatrix[4] = 0;
- modelMatrix[5] = 1;
- modelMatrix[6] = 0;
- modelMatrix[7] = 0;
- modelMatrix[8] = 0;
- modelMatrix[9] = 0;
- modelMatrix[10] = 1;
- modelMatrix[11] = 0;
- modelMatrix[12] = 0;
- modelMatrix[13] = 0;
- modelMatrix[14] = 0;
- modelMatrix[15] = 1;
-
- this.modelMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Scale model matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelScale
- * @since 3.0.0
- *
- * @param {number} x - The x component.
- * @param {number} y - The y component.
- * @param {number} z - The z component.
- *
- * @return {this} This Model View Projection.
- */
- modelScale: function (x, y, z)
- {
- var modelMatrix = this.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;
-
- this.modelMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Translate model matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelTranslate
- * @since 3.0.0
- *
- * @param {number} x - The x component.
- * @param {number} y - The y component.
- * @param {number} z - The z component.
- *
- * @return {this} This Model View Projection.
- */
- modelTranslate: function (x, y, z)
- {
- var modelMatrix = this.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];
-
- this.modelMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Rotates the model matrix in the X axis.
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateX
- * @since 3.0.0
- *
- * @param {number} radians - The amount to rotate by.
- *
- * @return {this} This Model View Projection.
- */
- modelRotateX: function (radians)
- {
- var modelMatrix = this.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;
-
- this.modelMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Rotates the model matrix in the Y axis.
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateY
- * @since 3.0.0
- *
- * @param {number} radians - The amount to rotate by.
- *
- * @return {this} This Model View Projection.
- */
- modelRotateY: function (radians)
- {
- var modelMatrix = this.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;
-
- this.modelMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Rotates the model matrix in the Z axis.
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateZ
- * @since 3.0.0
- *
- * @param {number} radians - The amount to rotate by.
- *
- * @return {this} This Model View Projection.
- */
- modelRotateZ: function (radians)
- {
- var modelMatrix = this.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;
-
- this.modelMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Loads identity matrix into the view matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewIdentity
- * @since 3.0.0
- *
- * @return {this} This Model View Projection.
- */
- viewIdentity: function ()
- {
- var viewMatrix = this.viewMatrix;
-
- viewMatrix[0] = 1;
- viewMatrix[1] = 0;
- viewMatrix[2] = 0;
- viewMatrix[3] = 0;
- viewMatrix[4] = 0;
- viewMatrix[5] = 1;
- viewMatrix[6] = 0;
- viewMatrix[7] = 0;
- viewMatrix[8] = 0;
- viewMatrix[9] = 0;
- viewMatrix[10] = 1;
- viewMatrix[11] = 0;
- viewMatrix[12] = 0;
- viewMatrix[13] = 0;
- viewMatrix[14] = 0;
- viewMatrix[15] = 1;
-
- this.viewMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Scales view matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewScale
- * @since 3.0.0
- *
- * @param {number} x - The x component.
- * @param {number} y - The y component.
- * @param {number} z - The z component.
- *
- * @return {this} This Model View Projection.
- */
- viewScale: function (x, y, z)
- {
- var viewMatrix = this.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;
-
- this.viewMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Translates view matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewTranslate
- * @since 3.0.0
- *
- * @param {number} x - The x component.
- * @param {number} y - The y component.
- * @param {number} z - The z component.
- *
- * @return {this} This Model View Projection.
- */
- viewTranslate: function (x, y, z)
- {
- var viewMatrix = this.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];
-
- this.viewMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Rotates view matrix in the X axis.
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateX
- * @since 3.0.0
- *
- * @param {number} radians - The amount to rotate by.
- *
- * @return {this} This Model View Projection.
- */
- viewRotateX: function (radians)
- {
- var viewMatrix = this.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;
-
- this.viewMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Rotates view matrix in the Y axis.
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateY
- * @since 3.0.0
- *
- * @param {number} radians - The amount to rotate by.
- *
- * @return {this} This Model View Projection.
- */
- viewRotateY: function (radians)
- {
- var viewMatrix = this.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;
-
- this.viewMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Rotates view matrix in the Z axis.
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateZ
- * @since 3.0.0
- *
- * @param {number} radians - The amount to rotate by.
- *
- * @return {this} This Model View Projection.
- */
- viewRotateZ: function (radians)
- {
- var viewMatrix = this.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;
-
- this.viewMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad2D
- * @since 3.0.0
- *
- * @param {Float32Array} matrix2D - The Matrix2D.
- *
- * @return {this} This Model View Projection.
- */
- viewLoad2D: function (matrix2D)
- {
- var vm = this.viewMatrix;
-
- vm[0] = matrix2D[0];
- vm[1] = matrix2D[1];
- vm[2] = 0.0;
- vm[3] = 0.0;
- vm[4] = matrix2D[2];
- vm[5] = matrix2D[3];
- vm[6] = 0.0;
- vm[7] = 0.0;
- vm[8] = matrix2D[4];
- vm[9] = matrix2D[5];
- vm[10] = 1.0;
- vm[11] = 0.0;
- vm[12] = 0.0;
- vm[13] = 0.0;
- vm[14] = 0.0;
- vm[15] = 1.0;
-
- this.viewMatrixDirty = true;
-
- return this;
- },
-
-
- /**
- * Copies a 4x4 matrix into the view matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad
- * @since 3.0.0
- *
- * @param {Float32Array} matrix - The Matrix2D.
- *
- * @return {this} This Model View Projection.
- */
- viewLoad: function (matrix)
- {
- var vm = this.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];
-
- this.viewMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Loads identity matrix into the projection matrix.
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projIdentity
- * @since 3.0.0
- *
- * @return {this} This Model View Projection.
- */
- projIdentity: function ()
- {
- var projectionMatrix = this.projectionMatrix;
-
- projectionMatrix[0] = 1;
- projectionMatrix[1] = 0;
- projectionMatrix[2] = 0;
- projectionMatrix[3] = 0;
- projectionMatrix[4] = 0;
- projectionMatrix[5] = 1;
- projectionMatrix[6] = 0;
- projectionMatrix[7] = 0;
- projectionMatrix[8] = 0;
- projectionMatrix[9] = 0;
- projectionMatrix[10] = 1;
- projectionMatrix[11] = 0;
- projectionMatrix[12] = 0;
- projectionMatrix[13] = 0;
- projectionMatrix[14] = 0;
- projectionMatrix[15] = 1;
-
- this.projectionMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Sets up an orthographic projection matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projOrtho
- * @since 3.0.0
- *
- * @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 {this} This Model View Projection.
- */
- projOrtho: function (left, right, bottom, top, near, far)
- {
- var projectionMatrix = this.projectionMatrix;
- var leftRight = 1.0 / (left - right);
- var bottomTop = 1.0 / (bottom - top);
- var nearFar = 1.0 / (near - far);
-
- projectionMatrix[0] = -2.0 * leftRight;
- projectionMatrix[1] = 0.0;
- projectionMatrix[2] = 0.0;
- projectionMatrix[3] = 0.0;
- projectionMatrix[4] = 0.0;
- projectionMatrix[5] = -2.0 * bottomTop;
- projectionMatrix[6] = 0.0;
- projectionMatrix[7] = 0.0;
- projectionMatrix[8] = 0.0;
- projectionMatrix[9] = 0.0;
- projectionMatrix[10] = 2.0 * nearFar;
- projectionMatrix[11] = 0.0;
- projectionMatrix[12] = (left + right) * leftRight;
- projectionMatrix[13] = (top + bottom) * bottomTop;
- projectionMatrix[14] = (far + near) * nearFar;
- projectionMatrix[15] = 1.0;
-
- this.projectionMatrixDirty = true;
-
- return this;
- },
-
- /**
- * Sets up a perspective projection matrix
- *
- * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projPersp
- * @since 3.0.0
- *
- * @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 {this} This Model View Projection.
- */
- projPersp: function (fovY, aspectRatio, near, far)
- {
- var projectionMatrix = this.projectionMatrix;
- var fov = 1.0 / Math.tan(fovY / 2.0);
- var nearFar = 1.0 / (near - far);
-
- projectionMatrix[0] = fov / aspectRatio;
- projectionMatrix[1] = 0.0;
- projectionMatrix[2] = 0.0;
- projectionMatrix[3] = 0.0;
- projectionMatrix[4] = 0.0;
- projectionMatrix[5] = fov;
- projectionMatrix[6] = 0.0;
- projectionMatrix[7] = 0.0;
- projectionMatrix[8] = 0.0;
- projectionMatrix[9] = 0.0;
- projectionMatrix[10] = (far + near) * nearFar;
- projectionMatrix[11] = -1.0;
- projectionMatrix[12] = 0.0;
- projectionMatrix[13] = 0.0;
- projectionMatrix[14] = (2.0 * far * near) * nearFar;
- projectionMatrix[15] = 0.0;
-
- this.projectionMatrixDirty = true;
-
- return this;
+ TextureTintPipeline.call(this, config);
}
-};
+});
-module.exports = ModelViewProjection;
+module.exports = TextureTintStripPipeline;
/***/ }),
-/* 507 */,
-/* 508 */,
-/* 509 */,
-/* 510 */,
-/* 511 */
+/* 514 */,
+/* 515 */,
+/* 516 */,
+/* 517 */,
+/* 518 */
/***/ (function(module, exports) {
var g;
@@ -116154,21 +119227,21 @@ module.exports = g;
/***/ }),
-/* 512 */
+/* 519 */
/***/ (function(module, exports, __webpack_require__) {
-__webpack_require__(513);
-__webpack_require__(514);
-__webpack_require__(515);
-__webpack_require__(516);
-__webpack_require__(517);
-__webpack_require__(518);
-__webpack_require__(519);
__webpack_require__(520);
+__webpack_require__(521);
+__webpack_require__(522);
+__webpack_require__(523);
+__webpack_require__(524);
+__webpack_require__(525);
+__webpack_require__(526);
+__webpack_require__(527);
/***/ }),
-/* 513 */
+/* 520 */
/***/ (function(module, exports) {
/**
@@ -116208,7 +119281,7 @@ if (!Array.prototype.forEach)
/***/ }),
-/* 514 */
+/* 521 */
/***/ (function(module, exports) {
/**
@@ -116224,7 +119297,7 @@ if (!Array.isArray)
/***/ }),
-/* 515 */
+/* 522 */
/***/ (function(module, exports) {
/* Copyright 2013 Chris Wilson
@@ -116411,7 +119484,7 @@ BiquadFilterNode.type and OscillatorNode.type.
/***/ }),
-/* 516 */
+/* 523 */
/***/ (function(module, exports) {
/**
@@ -116426,7 +119499,7 @@ if (!window.console)
/***/ }),
-/* 517 */
+/* 524 */
/***/ (function(module, exports) {
// ES6 Math.trunc - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
@@ -116438,7 +119511,7 @@ if (!Math.trunc) {
/***/ }),
-/* 518 */
+/* 525 */
/***/ (function(module, exports) {
/**
@@ -116475,7 +119548,7 @@ if (!Math.trunc) {
/***/ }),
-/* 519 */
+/* 526 */
/***/ (function(module, exports) {
// References:
@@ -116532,7 +119605,7 @@ if (!window.cancelAnimationFrame)
/***/ }),
-/* 520 */
+/* 527 */
/***/ (function(module, exports) {
/**
@@ -116585,7 +119658,7 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o
/***/ }),
-/* 521 */
+/* 528 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -116594,7 +119667,7 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var QuickSet = __webpack_require__(239);
+var QuickSet = __webpack_require__(246);
/**
* Takes an array of Game Objects, or any objects that have public `x` and `y` properties, and aligns them next to each other.
@@ -116633,7 +119706,7 @@ module.exports = AlignTo;
/***/ }),
-/* 522 */
+/* 529 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -116642,7 +119715,7 @@ module.exports = AlignTo;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PropertyValueInc = __webpack_require__(34);
+var PropertyValueInc = __webpack_require__(38);
/**
* Takes an array of Game Objects, or any objects that have a public `angle` property,
@@ -116674,7 +119747,7 @@ module.exports = Angle;
/***/ }),
-/* 523 */
+/* 530 */
/***/ (function(module, exports) {
/**
@@ -116713,7 +119786,7 @@ module.exports = Call;
/***/ }),
-/* 524 */
+/* 531 */
/***/ (function(module, exports) {
/**
@@ -116771,7 +119844,7 @@ module.exports = GetFirst;
/***/ }),
-/* 525 */
+/* 532 */
/***/ (function(module, exports) {
/**
@@ -116829,7 +119902,7 @@ module.exports = GetLast;
/***/ }),
-/* 526 */
+/* 533 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -116838,11 +119911,11 @@ module.exports = GetLast;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var AlignIn = __webpack_require__(252);
+var AlignIn = __webpack_require__(259);
var CONST = __webpack_require__(106);
var GetFastValue = __webpack_require__(2);
var NOOP = __webpack_require__(1);
-var Zone = __webpack_require__(110);
+var Zone = __webpack_require__(111);
var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1);
@@ -116928,7 +120001,7 @@ module.exports = GridAlign;
/***/ }),
-/* 527 */
+/* 534 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -116937,7 +120010,7 @@ module.exports = GridAlign;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Clamp = __webpack_require__(22);
+var Clamp = __webpack_require__(17);
// bitmask flag for GameObject.renderMask
var _FLAG = 2; // 0010
@@ -117223,7 +120296,7 @@ module.exports = Alpha;
/***/ }),
-/* 528 */
+/* 535 */
/***/ (function(module, exports) {
/**
@@ -117250,7 +120323,7 @@ module.exports = 'add';
/***/ }),
-/* 529 */
+/* 536 */
/***/ (function(module, exports) {
/**
@@ -117278,7 +120351,7 @@ module.exports = 'complete';
/***/ }),
-/* 530 */
+/* 537 */
/***/ (function(module, exports) {
/**
@@ -117305,7 +120378,7 @@ module.exports = 'repeat';
/***/ }),
-/* 531 */
+/* 538 */
/***/ (function(module, exports) {
/**
@@ -117333,7 +120406,7 @@ module.exports = 'restart';
/***/ }),
-/* 532 */
+/* 539 */
/***/ (function(module, exports) {
/**
@@ -117361,7 +120434,7 @@ module.exports = 'start';
/***/ }),
-/* 533 */
+/* 540 */
/***/ (function(module, exports) {
/**
@@ -117385,7 +120458,7 @@ module.exports = 'pauseall';
/***/ }),
-/* 534 */
+/* 541 */
/***/ (function(module, exports) {
/**
@@ -117409,7 +120482,7 @@ module.exports = 'remove';
/***/ }),
-/* 535 */
+/* 542 */
/***/ (function(module, exports) {
/**
@@ -117432,7 +120505,7 @@ module.exports = 'resumeall';
/***/ }),
-/* 536 */
+/* 543 */
/***/ (function(module, exports) {
/**
@@ -117461,7 +120534,7 @@ module.exports = 'animationcomplete';
/***/ }),
-/* 537 */
+/* 544 */
/***/ (function(module, exports) {
/**
@@ -117489,7 +120562,7 @@ module.exports = 'animationcomplete-';
/***/ }),
-/* 538 */
+/* 545 */
/***/ (function(module, exports) {
/**
@@ -117518,7 +120591,7 @@ module.exports = 'animationrepeat-';
/***/ }),
-/* 539 */
+/* 546 */
/***/ (function(module, exports) {
/**
@@ -117546,7 +120619,7 @@ module.exports = 'animationrestart-';
/***/ }),
-/* 540 */
+/* 547 */
/***/ (function(module, exports) {
/**
@@ -117574,7 +120647,7 @@ module.exports = 'animationstart-';
/***/ }),
-/* 541 */
+/* 548 */
/***/ (function(module, exports) {
/**
@@ -117603,7 +120676,7 @@ module.exports = 'animationupdate-';
/***/ }),
-/* 542 */
+/* 549 */
/***/ (function(module, exports) {
/**
@@ -117633,7 +120706,7 @@ module.exports = 'animationrepeat';
/***/ }),
-/* 543 */
+/* 550 */
/***/ (function(module, exports) {
/**
@@ -117662,7 +120735,7 @@ module.exports = 'animationrestart';
/***/ }),
-/* 544 */
+/* 551 */
/***/ (function(module, exports) {
/**
@@ -117691,7 +120764,7 @@ module.exports = 'animationstart';
/***/ }),
-/* 545 */
+/* 552 */
/***/ (function(module, exports) {
/**
@@ -117721,7 +120794,7 @@ module.exports = 'animationupdate';
/***/ }),
-/* 546 */
+/* 553 */
/***/ (function(module, exports) {
/**
@@ -117870,7 +120943,7 @@ module.exports = ComputedSize;
/***/ }),
-/* 547 */
+/* 554 */
/***/ (function(module, exports) {
/**
@@ -117995,7 +121068,7 @@ module.exports = Crop;
/***/ }),
-/* 548 */
+/* 555 */
/***/ (function(module, exports) {
/**
@@ -118159,7 +121232,7 @@ module.exports = Flip;
/***/ }),
-/* 549 */
+/* 556 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -118168,8 +121241,8 @@ module.exports = Flip;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Rectangle = __webpack_require__(11);
-var RotateAround = __webpack_require__(273);
+var Rectangle = __webpack_require__(9);
+var RotateAround = __webpack_require__(280);
var Vector2 = __webpack_require__(3);
/**
@@ -118518,7 +121591,7 @@ module.exports = GetBounds;
/***/ }),
-/* 550 */
+/* 557 */
/***/ (function(module, exports) {
/**
@@ -118541,7 +121614,7 @@ module.exports = 'blur';
/***/ }),
-/* 551 */
+/* 558 */
/***/ (function(module, exports) {
/**
@@ -118563,7 +121636,7 @@ module.exports = 'boot';
/***/ }),
-/* 552 */
+/* 559 */
/***/ (function(module, exports) {
/**
@@ -118586,7 +121659,7 @@ module.exports = 'contextlost';
/***/ }),
-/* 553 */
+/* 560 */
/***/ (function(module, exports) {
/**
@@ -118609,7 +121682,7 @@ module.exports = 'contextrestored';
/***/ }),
-/* 554 */
+/* 561 */
/***/ (function(module, exports) {
/**
@@ -118632,7 +121705,7 @@ module.exports = 'destroy';
/***/ }),
-/* 555 */
+/* 562 */
/***/ (function(module, exports) {
/**
@@ -118654,7 +121727,7 @@ module.exports = 'focus';
/***/ }),
-/* 556 */
+/* 563 */
/***/ (function(module, exports) {
/**
@@ -118680,7 +121753,7 @@ module.exports = 'hidden';
/***/ }),
-/* 557 */
+/* 564 */
/***/ (function(module, exports) {
/**
@@ -118701,7 +121774,7 @@ module.exports = 'pause';
/***/ }),
-/* 558 */
+/* 565 */
/***/ (function(module, exports) {
/**
@@ -118727,7 +121800,7 @@ module.exports = 'postrender';
/***/ }),
-/* 559 */
+/* 566 */
/***/ (function(module, exports) {
/**
@@ -118752,7 +121825,7 @@ module.exports = 'poststep';
/***/ }),
-/* 560 */
+/* 567 */
/***/ (function(module, exports) {
/**
@@ -118777,7 +121850,7 @@ module.exports = 'prerender';
/***/ }),
-/* 561 */
+/* 568 */
/***/ (function(module, exports) {
/**
@@ -118802,7 +121875,7 @@ module.exports = 'prestep';
/***/ }),
-/* 562 */
+/* 569 */
/***/ (function(module, exports) {
/**
@@ -118824,7 +121897,7 @@ module.exports = 'ready';
/***/ }),
-/* 563 */
+/* 570 */
/***/ (function(module, exports) {
/**
@@ -118845,7 +121918,7 @@ module.exports = 'resume';
/***/ }),
-/* 564 */
+/* 571 */
/***/ (function(module, exports) {
/**
@@ -118870,7 +121943,7 @@ module.exports = 'step';
/***/ }),
-/* 565 */
+/* 572 */
/***/ (function(module, exports) {
/**
@@ -118894,7 +121967,7 @@ module.exports = 'visible';
/***/ }),
-/* 566 */
+/* 573 */
/***/ (function(module, exports) {
/**
@@ -119097,7 +122170,7 @@ module.exports = Origin;
/***/ }),
-/* 567 */
+/* 574 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -119106,7 +122179,7 @@ module.exports = Origin;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var DegToRad = __webpack_require__(35);
+var DegToRad = __webpack_require__(39);
var GetBoolean = __webpack_require__(88);
var GetValue = __webpack_require__(6);
var TWEEN_CONST = __webpack_require__(89);
@@ -119172,6 +122245,15 @@ var PathFollower = {
*/
pathVector: null,
+ /**
+ * The distance the follower has traveled from the previous point to the current one, at the last update.
+ *
+ * @name Phaser.GameObjects.PathFollower#pathDelta
+ * @type {Phaser.Math.Vector2}
+ * @since 3.23.0
+ */
+ pathDelta: null,
+
/**
* The Tween used for following the Path.
*
@@ -119212,7 +122294,7 @@ var PathFollower = {
* @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time.
* @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower.
*
- * @return {Phaser.GameObjects.PathFollower} This Game Object.
+ * @return {this} This Game Object.
*/
setPath: function (path, config)
{
@@ -119244,7 +122326,7 @@ var PathFollower = {
* @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path.
* @param {number} [offset=0] - Rotation offset in degrees.
*
- * @return {Phaser.GameObjects.PathFollower} This Game Object.
+ * @return {this} This Game Object.
*/
setRotateToPath: function (value, offset)
{
@@ -119283,7 +122365,7 @@ var PathFollower = {
* @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object.
* @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1.
*
- * @return {Phaser.GameObjects.PathFollower} This Game Object.
+ * @return {this} This Game Object.
*/
startFollow: function (config, startAt)
{
@@ -119337,6 +122419,13 @@ var PathFollower = {
this.pathVector = new Vector2();
}
+ if (!this.pathDelta)
+ {
+ this.pathDelta = new Vector2();
+ }
+
+ this.pathDelta.reset();
+
this.pathTween = this.scene.sys.tweens.addCounter(config);
// The starting point of the path, relative to this follower
@@ -119373,7 +122462,7 @@ var PathFollower = {
* @method Phaser.GameObjects.Components.PathFollower#pauseFollow
* @since 3.3.0
*
- * @return {Phaser.GameObjects.PathFollower} This Game Object.
+ * @return {this} This Game Object.
*/
pauseFollow: function ()
{
@@ -119395,7 +122484,7 @@ var PathFollower = {
* @method Phaser.GameObjects.Components.PathFollower#resumeFollow
* @since 3.3.0
*
- * @return {Phaser.GameObjects.PathFollower} This Game Object.
+ * @return {this} This Game Object.
*/
resumeFollow: function ()
{
@@ -119417,7 +122506,7 @@ var PathFollower = {
* @method Phaser.GameObjects.Components.PathFollower#stopFollow
* @since 3.3.0
*
- * @return {Phaser.GameObjects.PathFollower} This Game Object.
+ * @return {this} This Game Object.
*/
stopFollow: function ()
{
@@ -119446,14 +122535,18 @@ var PathFollower = {
if (tween)
{
var tweenData = tween.data[0];
+ var pathDelta = this.pathDelta;
var pathVector = this.pathVector;
- if (tweenData.state !== TWEEN_CONST.COMPLETE)
+ pathDelta.copy(pathVector).negate();
+
+ if (tweenData.state === TWEEN_CONST.COMPLETE)
{
this.path.getPoint(1, pathVector);
+ pathDelta.add(pathVector);
pathVector.add(this.pathOffset);
-
+
this.setPosition(pathVector.x, pathVector.y);
return;
@@ -119466,6 +122559,7 @@ var PathFollower = {
this.path.getPoint(tween.getValue(), pathVector);
+ pathDelta.add(pathVector);
pathVector.add(this.pathOffset);
var oldX = this.x;
@@ -119503,7 +122597,7 @@ module.exports = PathFollower;
/***/ }),
-/* 568 */
+/* 575 */
/***/ (function(module, exports) {
/**
@@ -119690,7 +122784,7 @@ module.exports = Size;
/***/ }),
-/* 569 */
+/* 576 */
/***/ (function(module, exports) {
/**
@@ -119820,7 +122914,7 @@ module.exports = Texture;
/***/ }),
-/* 570 */
+/* 577 */
/***/ (function(module, exports) {
/**
@@ -120028,8 +123122,8 @@ module.exports = TextureCrop;
/***/ }),
-/* 571 */
-/***/ (function(module, exports) {
+/* 578 */
+/***/ (function(module, exports, __webpack_require__) {
/**
* @author Richard Davey
@@ -120037,20 +123131,12 @@ module.exports = TextureCrop;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-/**
- * @function GetColor
- * @since 3.0.0
- * @private
- */
-var GetColor = function (value)
-{
- return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);
-};
+var GetColorFromValue = __webpack_require__(114);
/**
* Provides methods used for setting the tint of a Game Object.
* Should be applied as a mixin and not used directly.
- *
+ *
* @namespace Phaser.GameObjects.Components.Tint
* @webglOnly
* @since 3.0.0
@@ -120060,7 +123146,7 @@ var Tint = {
/**
* Private internal value. Holds the top-left tint value.
- *
+ *
* @name Phaser.GameObjects.Components.Tint#_tintTL
* @type {number}
* @private
@@ -120071,7 +123157,7 @@ var Tint = {
/**
* Private internal value. Holds the top-right tint value.
- *
+ *
* @name Phaser.GameObjects.Components.Tint#_tintTR
* @type {number}
* @private
@@ -120082,7 +123168,7 @@ var Tint = {
/**
* Private internal value. Holds the bottom-left tint value.
- *
+ *
* @name Phaser.GameObjects.Components.Tint#_tintBL
* @type {number}
* @private
@@ -120093,7 +123179,7 @@ var Tint = {
/**
* Private internal value. Holds the bottom-right tint value.
- *
+ *
* @name Phaser.GameObjects.Components.Tint#_tintBR
* @type {number}
* @private
@@ -120104,7 +123190,7 @@ var Tint = {
/**
* Private internal value. Holds if the Game Object is tinted or not.
- *
+ *
* @name Phaser.GameObjects.Components.Tint#_isTinted
* @type {boolean}
* @private
@@ -120115,7 +123201,7 @@ var Tint = {
/**
* Fill or additive?
- *
+ *
* @name Phaser.GameObjects.Components.Tint#tintFill
* @type {boolean}
* @default false
@@ -120125,14 +123211,14 @@ var Tint = {
/**
* Clears all tint values associated with this Game Object.
- *
+ *
* Immediately sets the color values back to 0xffffff and the tint type to 'additive',
* which results in no visible change to the texture.
*
* @method Phaser.GameObjects.Components.Tint#clearTint
* @webglOnly
* @since 3.0.0
- *
+ *
* @return {this} This Game Object instance.
*/
clearTint: function ()
@@ -120146,18 +123232,18 @@ var Tint = {
/**
* Sets an additive tint on this Game Object.
- *
+ *
* The tint works by taking the pixel color values from the Game Objects texture, and then
* multiplying it by the color value of the tint. You can provide either one color value,
* in which case the whole Game Object will be tinted in that color. Or you can provide a color
* per corner. The colors are blended together across the extent of the Game Object.
- *
+ *
* To modify the tint color once set, either call this method again with new values or use the
* `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight,
* `tintBottomLeft` and `tintBottomRight` to set the corner color values independently.
- *
+ *
* To remove a tint call `clearTint`.
- *
+ *
* To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`.
*
* @method Phaser.GameObjects.Components.Tint#setTint
@@ -120168,7 +123254,7 @@ var Tint = {
* @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.
- *
+ *
* @return {this} This Game Object instance.
*/
setTint: function (topLeft, topRight, bottomLeft, bottomRight)
@@ -120182,10 +123268,10 @@ var Tint = {
bottomRight = topLeft;
}
- this._tintTL = GetColor(topLeft);
- this._tintTR = GetColor(topRight);
- this._tintBL = GetColor(bottomLeft);
- this._tintBR = GetColor(bottomRight);
+ this._tintTL = GetColorFromValue(topLeft);
+ this._tintTR = GetColorFromValue(topRight);
+ this._tintBL = GetColorFromValue(bottomLeft);
+ this._tintBR = GetColorFromValue(bottomRight);
this._isTinted = true;
@@ -120196,19 +123282,19 @@ var Tint = {
/**
* Sets a fill-based tint on this Game Object.
- *
+ *
* 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. You can provide either one color value, in which case the whole
* Game Object will be rendered in that color. Or you can provide a color per corner. The colors
* are blended together across the extent of the Game Object.
- *
+ *
* To modify the tint color once set, either call this method again with new values or use the
* `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight,
* `tintBottomLeft` and `tintBottomRight` to set the corner color values independently.
- *
+ *
* To remove a tint call `clearTint`.
- *
+ *
* To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`.
*
* @method Phaser.GameObjects.Components.Tint#setTintFill
@@ -120219,7 +123305,7 @@ var Tint = {
* @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.
- *
+ *
* @return {this} This Game Object instance.
*/
setTintFill: function (topLeft, topRight, bottomLeft, bottomRight)
@@ -120234,7 +123320,7 @@ var Tint = {
/**
* 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
@@ -120249,7 +123335,7 @@ var Tint = {
set: function (value)
{
- this._tintTL = GetColor(value);
+ this._tintTL = GetColorFromValue(value);
this._isTinted = true;
}
@@ -120258,7 +123344,7 @@ var Tint = {
/**
* 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
@@ -120273,7 +123359,7 @@ var Tint = {
set: function (value)
{
- this._tintTR = GetColor(value);
+ this._tintTR = GetColorFromValue(value);
this._isTinted = true;
}
@@ -120282,7 +123368,7 @@ var Tint = {
/**
* 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
@@ -120297,7 +123383,7 @@ var Tint = {
set: function (value)
{
- this._tintBL = GetColor(value);
+ this._tintBL = GetColorFromValue(value);
this._isTinted = true;
}
@@ -120306,7 +123392,7 @@ var Tint = {
/**
* 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
@@ -120321,7 +123407,7 @@ var Tint = {
set: function (value)
{
- this._tintBR = GetColor(value);
+ this._tintBR = GetColorFromValue(value);
this._isTinted = true;
}
@@ -120330,7 +123416,7 @@ var Tint = {
/**
* 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}
* @webglOnly
@@ -120346,7 +123432,7 @@ var Tint = {
/**
* Does this Game Object have a tint applied to it or not?
- *
+ *
* @name Phaser.GameObjects.Components.Tint#isTinted
* @type {boolean}
* @webglOnly
@@ -120368,7 +123454,7 @@ module.exports = Tint;
/***/ }),
-/* 572 */
+/* 579 */
/***/ (function(module, exports) {
/**
@@ -120400,7 +123486,7 @@ module.exports = 'changedata';
/***/ }),
-/* 573 */
+/* 580 */
/***/ (function(module, exports) {
/**
@@ -120430,7 +123516,7 @@ module.exports = 'changedata-';
/***/ }),
-/* 574 */
+/* 581 */
/***/ (function(module, exports) {
/**
@@ -120458,7 +123544,7 @@ module.exports = 'removedata';
/***/ }),
-/* 575 */
+/* 582 */
/***/ (function(module, exports) {
/**
@@ -120486,7 +123572,7 @@ module.exports = 'setdata';
/***/ }),
-/* 576 */
+/* 583 */
/***/ (function(module, exports) {
/**
@@ -120511,7 +123597,7 @@ module.exports = 'destroy';
/***/ }),
-/* 577 */
+/* 584 */
/***/ (function(module, exports) {
/**
@@ -120543,7 +123629,7 @@ module.exports = 'complete';
/***/ }),
-/* 578 */
+/* 585 */
/***/ (function(module, exports) {
/**
@@ -120572,7 +123658,7 @@ module.exports = 'created';
/***/ }),
-/* 579 */
+/* 586 */
/***/ (function(module, exports) {
/**
@@ -120598,7 +123684,7 @@ module.exports = 'error';
/***/ }),
-/* 580 */
+/* 587 */
/***/ (function(module, exports) {
/**
@@ -120630,7 +123716,7 @@ module.exports = 'loop';
/***/ }),
-/* 581 */
+/* 588 */
/***/ (function(module, exports) {
/**
@@ -120658,7 +123744,7 @@ module.exports = 'play';
/***/ }),
-/* 582 */
+/* 589 */
/***/ (function(module, exports) {
/**
@@ -120683,7 +123769,7 @@ module.exports = 'seeked';
/***/ }),
-/* 583 */
+/* 590 */
/***/ (function(module, exports) {
/**
@@ -120709,7 +123795,7 @@ module.exports = 'seeking';
/***/ }),
-/* 584 */
+/* 591 */
/***/ (function(module, exports) {
/**
@@ -120735,7 +123821,7 @@ module.exports = 'stop';
/***/ }),
-/* 585 */
+/* 592 */
/***/ (function(module, exports) {
/**
@@ -120761,7 +123847,7 @@ module.exports = 'timeout';
/***/ }),
-/* 586 */
+/* 593 */
/***/ (function(module, exports) {
/**
@@ -120787,7 +123873,7 @@ module.exports = 'unlocked';
/***/ }),
-/* 587 */
+/* 594 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -120796,7 +123882,7 @@ module.exports = 'unlocked';
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PropertyValueInc = __webpack_require__(34);
+var PropertyValueInc = __webpack_require__(38);
/**
* Takes an array of Game Objects, or any objects that have a public `alpha` property,
@@ -120828,7 +123914,7 @@ module.exports = IncAlpha;
/***/ }),
-/* 588 */
+/* 595 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -120837,7 +123923,7 @@ module.exports = IncAlpha;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PropertyValueInc = __webpack_require__(34);
+var PropertyValueInc = __webpack_require__(38);
/**
* Takes an array of Game Objects, or any objects that have a public `x` property,
@@ -120869,7 +123955,7 @@ module.exports = IncX;
/***/ }),
-/* 589 */
+/* 596 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -120878,7 +123964,7 @@ module.exports = IncX;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PropertyValueInc = __webpack_require__(34);
+var PropertyValueInc = __webpack_require__(38);
/**
* Takes an array of Game Objects, or any objects that have public `x` and `y` properties,
@@ -120916,7 +124002,7 @@ module.exports = IncXY;
/***/ }),
-/* 590 */
+/* 597 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -120925,7 +124011,7 @@ module.exports = IncXY;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PropertyValueInc = __webpack_require__(34);
+var PropertyValueInc = __webpack_require__(38);
/**
* Takes an array of Game Objects, or any objects that have a public `y` property,
@@ -120957,7 +124043,7 @@ module.exports = IncY;
/***/ }),
-/* 591 */
+/* 598 */
/***/ (function(module, exports) {
/**
@@ -121006,7 +124092,7 @@ module.exports = PlaceOnCircle;
/***/ }),
-/* 592 */
+/* 599 */
/***/ (function(module, exports) {
/**
@@ -121058,7 +124144,7 @@ module.exports = PlaceOnEllipse;
/***/ }),
-/* 593 */
+/* 600 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121067,7 +124153,7 @@ module.exports = PlaceOnEllipse;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetPoints = __webpack_require__(150);
+var GetPoints = __webpack_require__(157);
/**
* Positions an array of Game Objects on evenly spaced points of a Line.
@@ -121102,7 +124188,7 @@ module.exports = PlaceOnLine;
/***/ }),
-/* 594 */
+/* 601 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121111,9 +124197,9 @@ module.exports = PlaceOnLine;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var MarchingAnts = __webpack_require__(282);
-var RotateLeft = __webpack_require__(283);
-var RotateRight = __webpack_require__(284);
+var MarchingAnts = __webpack_require__(289);
+var RotateLeft = __webpack_require__(290);
+var RotateRight = __webpack_require__(291);
/**
* Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle.
@@ -121160,7 +124246,7 @@ module.exports = PlaceOnRectangle;
/***/ }),
-/* 595 */
+/* 602 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121169,7 +124255,7 @@ module.exports = PlaceOnRectangle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BresenhamPoints = __webpack_require__(285);
+var BresenhamPoints = __webpack_require__(292);
/**
* Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle.
@@ -121221,7 +124307,7 @@ module.exports = PlaceOnTriangle;
/***/ }),
-/* 596 */
+/* 603 */
/***/ (function(module, exports) {
/**
@@ -121258,7 +124344,7 @@ module.exports = PlayAnimation;
/***/ }),
-/* 597 */
+/* 604 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121267,7 +124353,7 @@ module.exports = PlayAnimation;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Random = __webpack_require__(147);
+var Random = __webpack_require__(154);
/**
* Takes an array of Game Objects and positions them at random locations within the Circle.
@@ -121298,7 +124384,7 @@ module.exports = RandomCircle;
/***/ }),
-/* 598 */
+/* 605 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121307,7 +124393,7 @@ module.exports = RandomCircle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Random = __webpack_require__(154);
+var Random = __webpack_require__(162);
/**
* Takes an array of Game Objects and positions them at random locations within the Ellipse.
@@ -121338,7 +124424,7 @@ module.exports = RandomEllipse;
/***/ }),
-/* 599 */
+/* 606 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121347,7 +124433,7 @@ module.exports = RandomEllipse;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Random = __webpack_require__(151);
+var Random = __webpack_require__(158);
/**
* Takes an array of Game Objects and positions them at random locations on the Line.
@@ -121378,7 +124464,7 @@ module.exports = RandomLine;
/***/ }),
-/* 600 */
+/* 607 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121387,7 +124473,7 @@ module.exports = RandomLine;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Random = __webpack_require__(152);
+var Random = __webpack_require__(159);
/**
* Takes an array of Game Objects and positions them at random locations within the Rectangle.
@@ -121416,7 +124502,7 @@ module.exports = RandomRectangle;
/***/ }),
-/* 601 */
+/* 608 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121425,7 +124511,7 @@ module.exports = RandomRectangle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Random = __webpack_require__(155);
+var Random = __webpack_require__(163);
/**
* Takes an array of Game Objects and positions them at random locations within the Triangle.
@@ -121456,7 +124542,7 @@ module.exports = RandomTriangle;
/***/ }),
-/* 602 */
+/* 609 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121465,7 +124551,7 @@ module.exports = RandomTriangle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PropertyValueInc = __webpack_require__(34);
+var PropertyValueInc = __webpack_require__(38);
/**
* Takes an array of Game Objects, or any objects that have a public `rotation` property,
@@ -121497,7 +124583,7 @@ module.exports = Rotate;
/***/ }),
-/* 603 */
+/* 610 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121506,8 +124592,8 @@ module.exports = Rotate;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RotateAroundDistance = __webpack_require__(156);
-var DistanceBetween = __webpack_require__(53);
+var RotateAroundDistance = __webpack_require__(164);
+var DistanceBetween = __webpack_require__(54);
/**
* Rotates each item around the given point by the given angle.
@@ -121543,7 +124629,7 @@ module.exports = RotateAround;
/***/ }),
-/* 604 */
+/* 611 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121552,7 +124638,7 @@ module.exports = RotateAround;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var MathRotateAroundDistance = __webpack_require__(156);
+var MathRotateAroundDistance = __webpack_require__(164);
/**
* Rotates an array of Game Objects around a point by the given angle and distance.
@@ -121592,7 +124678,7 @@ module.exports = RotateAroundDistance;
/***/ }),
-/* 605 */
+/* 612 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121601,7 +124687,7 @@ module.exports = RotateAroundDistance;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PropertyValueInc = __webpack_require__(34);
+var PropertyValueInc = __webpack_require__(38);
/**
* Takes an array of Game Objects, or any objects that have a public `scaleX` property,
@@ -121633,7 +124719,7 @@ module.exports = ScaleX;
/***/ }),
-/* 606 */
+/* 613 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121642,7 +124728,7 @@ module.exports = ScaleX;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PropertyValueInc = __webpack_require__(34);
+var PropertyValueInc = __webpack_require__(38);
/**
* Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties,
@@ -121680,7 +124766,7 @@ module.exports = ScaleXY;
/***/ }),
-/* 607 */
+/* 614 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121689,7 +124775,7 @@ module.exports = ScaleXY;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PropertyValueInc = __webpack_require__(34);
+var PropertyValueInc = __webpack_require__(38);
/**
* Takes an array of Game Objects, or any objects that have a public `scaleY` property,
@@ -121721,7 +124807,7 @@ module.exports = ScaleY;
/***/ }),
-/* 608 */
+/* 615 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121762,7 +124848,7 @@ module.exports = SetAlpha;
/***/ }),
-/* 609 */
+/* 616 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121802,7 +124888,7 @@ module.exports = SetBlendMode;
/***/ }),
-/* 610 */
+/* 617 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121843,7 +124929,7 @@ module.exports = SetDepth;
/***/ }),
-/* 611 */
+/* 618 */
/***/ (function(module, exports) {
/**
@@ -121882,7 +124968,7 @@ module.exports = SetHitArea;
/***/ }),
-/* 612 */
+/* 619 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121929,7 +125015,7 @@ module.exports = SetOrigin;
/***/ }),
-/* 613 */
+/* 620 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -121970,7 +125056,7 @@ module.exports = SetRotation;
/***/ }),
-/* 614 */
+/* 621 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122017,7 +125103,7 @@ module.exports = SetScale;
/***/ }),
-/* 615 */
+/* 622 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122058,7 +125144,7 @@ module.exports = SetScaleX;
/***/ }),
-/* 616 */
+/* 623 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122099,7 +125185,7 @@ module.exports = SetScaleY;
/***/ }),
-/* 617 */
+/* 624 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122146,7 +125232,7 @@ module.exports = SetScrollFactor;
/***/ }),
-/* 618 */
+/* 625 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122187,7 +125273,7 @@ module.exports = SetScrollFactorX;
/***/ }),
-/* 619 */
+/* 626 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122228,7 +125314,7 @@ module.exports = SetScrollFactorY;
/***/ }),
-/* 620 */
+/* 627 */
/***/ (function(module, exports) {
/**
@@ -122267,7 +125353,7 @@ module.exports = SetTint;
/***/ }),
-/* 621 */
+/* 628 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122305,7 +125391,7 @@ module.exports = SetVisible;
/***/ }),
-/* 622 */
+/* 629 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122346,7 +125432,7 @@ module.exports = SetX;
/***/ }),
-/* 623 */
+/* 630 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122393,7 +125479,7 @@ module.exports = SetXY;
/***/ }),
-/* 624 */
+/* 631 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122434,7 +125520,7 @@ module.exports = SetY;
/***/ }),
-/* 625 */
+/* 632 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122564,7 +125650,7 @@ module.exports = ShiftPosition;
/***/ }),
-/* 626 */
+/* 633 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122573,7 +125659,7 @@ module.exports = ShiftPosition;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ArrayShuffle = __webpack_require__(114);
+var ArrayShuffle = __webpack_require__(116);
/**
* Shuffles the array in place. The shuffled array is both modified and returned.
@@ -122597,7 +125683,7 @@ module.exports = Shuffle;
/***/ }),
-/* 627 */
+/* 634 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122606,7 +125692,7 @@ module.exports = Shuffle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var MathSmootherStep = __webpack_require__(157);
+var MathSmootherStep = __webpack_require__(165);
/**
* Smootherstep is a sigmoid-like interpolation and clamping function.
@@ -122655,7 +125741,7 @@ module.exports = SmootherStep;
/***/ }),
-/* 628 */
+/* 635 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122664,7 +125750,7 @@ module.exports = SmootherStep;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var MathSmoothStep = __webpack_require__(158);
+var MathSmoothStep = __webpack_require__(166);
/**
* Smoothstep is a sigmoid-like interpolation and clamping function.
@@ -122713,7 +125799,7 @@ module.exports = SmoothStep;
/***/ }),
-/* 629 */
+/* 636 */
/***/ (function(module, exports) {
/**
@@ -122776,7 +125862,7 @@ module.exports = Spread;
/***/ }),
-/* 630 */
+/* 637 */
/***/ (function(module, exports) {
/**
@@ -122812,7 +125898,7 @@ module.exports = ToggleVisible;
/***/ }),
-/* 631 */
+/* 638 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122861,7 +125947,7 @@ module.exports = WrapInRectangle;
/***/ }),
-/* 632 */
+/* 639 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122876,16 +125962,16 @@ module.exports = WrapInRectangle;
module.exports = {
- Animation: __webpack_require__(148),
- AnimationFrame: __webpack_require__(268),
- AnimationManager: __webpack_require__(286),
- Events: __webpack_require__(111)
+ Animation: __webpack_require__(155),
+ AnimationFrame: __webpack_require__(275),
+ AnimationManager: __webpack_require__(293),
+ Events: __webpack_require__(112)
};
/***/ }),
-/* 633 */
+/* 640 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122900,15 +125986,15 @@ module.exports = {
module.exports = {
- BaseCache: __webpack_require__(287),
- CacheManager: __webpack_require__(289),
- Events: __webpack_require__(288)
+ BaseCache: __webpack_require__(294),
+ CacheManager: __webpack_require__(296),
+ Events: __webpack_require__(295)
};
/***/ }),
-/* 634 */
+/* 641 */
/***/ (function(module, exports) {
/**
@@ -122933,7 +126019,7 @@ module.exports = 'add';
/***/ }),
-/* 635 */
+/* 642 */
/***/ (function(module, exports) {
/**
@@ -122958,7 +126044,7 @@ module.exports = 'remove';
/***/ }),
-/* 636 */
+/* 643 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122977,14 +126063,14 @@ module.exports = 'remove';
module.exports = {
- Controls: __webpack_require__(637),
- Scene2D: __webpack_require__(640)
+ Controls: __webpack_require__(644),
+ Scene2D: __webpack_require__(647)
};
/***/ }),
-/* 637 */
+/* 644 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -122999,14 +126085,14 @@ module.exports = {
module.exports = {
- FixedKeyControl: __webpack_require__(638),
- SmoothedKeyControl: __webpack_require__(639)
+ FixedKeyControl: __webpack_require__(645),
+ SmoothedKeyControl: __webpack_require__(646)
};
/***/ }),
-/* 638 */
+/* 645 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -123190,7 +126276,7 @@ var FixedKeyControl = new Class({
* @method Phaser.Cameras.Controls.FixedKeyControl#start
* @since 3.0.0
*
- * @return {Phaser.Cameras.Controls.FixedKeyControl} This Key Control instance.
+ * @return {this} This Key Control instance.
*/
start: function ()
{
@@ -123205,7 +126291,7 @@ var FixedKeyControl = new Class({
* @method Phaser.Cameras.Controls.FixedKeyControl#stop
* @since 3.0.0
*
- * @return {Phaser.Cameras.Controls.FixedKeyControl} This Key Control instance.
+ * @return {this} This Key Control instance.
*/
stop: function ()
{
@@ -123222,7 +126308,7 @@ var FixedKeyControl = new Class({
*
* @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to bind this Key Control to.
*
- * @return {Phaser.Cameras.Controls.FixedKeyControl} This Key Control instance.
+ * @return {this} This Key Control instance.
*/
setCamera: function (camera)
{
@@ -123312,7 +126398,7 @@ module.exports = FixedKeyControl;
/***/ }),
-/* 639 */
+/* 646 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -123590,7 +126676,7 @@ var SmoothedKeyControl = new Class({
* @method Phaser.Cameras.Controls.SmoothedKeyControl#start
* @since 3.0.0
*
- * @return {Phaser.Cameras.Controls.SmoothedKeyControl} This Key Control instance.
+ * @return {this} This Key Control instance.
*/
start: function ()
{
@@ -123605,7 +126691,7 @@ var SmoothedKeyControl = new Class({
* @method Phaser.Cameras.Controls.SmoothedKeyControl#stop
* @since 3.0.0
*
- * @return {Phaser.Cameras.Controls.SmoothedKeyControl} This Key Control instance.
+ * @return {this} This Key Control instance.
*/
stop: function ()
{
@@ -123622,7 +126708,7 @@ var SmoothedKeyControl = new Class({
*
* @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to bind this Key Control to.
*
- * @return {Phaser.Cameras.Controls.SmoothedKeyControl} This Key Control instance.
+ * @return {this} This Key Control instance.
*/
setCamera: function (camera)
{
@@ -123795,7 +126881,7 @@ module.exports = SmoothedKeyControl;
/***/ }),
-/* 640 */
+/* 647 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -123810,17 +126896,17 @@ module.exports = SmoothedKeyControl;
module.exports = {
- Camera: __webpack_require__(290),
+ Camera: __webpack_require__(297),
BaseCamera: __webpack_require__(91),
- CameraManager: __webpack_require__(693),
- Effects: __webpack_require__(298),
- Events: __webpack_require__(48)
+ CameraManager: __webpack_require__(703),
+ Effects: __webpack_require__(305),
+ Events: __webpack_require__(40)
};
/***/ }),
-/* 641 */
+/* 648 */
/***/ (function(module, exports) {
/**
@@ -123843,7 +126929,7 @@ module.exports = 'cameradestroy';
/***/ }),
-/* 642 */
+/* 649 */
/***/ (function(module, exports) {
/**
@@ -123869,7 +126955,7 @@ module.exports = 'camerafadeincomplete';
/***/ }),
-/* 643 */
+/* 650 */
/***/ (function(module, exports) {
/**
@@ -123899,7 +126985,7 @@ module.exports = 'camerafadeinstart';
/***/ }),
-/* 644 */
+/* 651 */
/***/ (function(module, exports) {
/**
@@ -123925,7 +127011,7 @@ module.exports = 'camerafadeoutcomplete';
/***/ }),
-/* 645 */
+/* 652 */
/***/ (function(module, exports) {
/**
@@ -123955,7 +127041,7 @@ module.exports = 'camerafadeoutstart';
/***/ }),
-/* 646 */
+/* 653 */
/***/ (function(module, exports) {
/**
@@ -123979,7 +127065,7 @@ module.exports = 'cameraflashcomplete';
/***/ }),
-/* 647 */
+/* 654 */
/***/ (function(module, exports) {
/**
@@ -124007,7 +127093,7 @@ module.exports = 'cameraflashstart';
/***/ }),
-/* 648 */
+/* 655 */
/***/ (function(module, exports) {
/**
@@ -124031,7 +127117,7 @@ module.exports = 'camerapancomplete';
/***/ }),
-/* 649 */
+/* 656 */
/***/ (function(module, exports) {
/**
@@ -124058,7 +127144,7 @@ module.exports = 'camerapanstart';
/***/ }),
-/* 650 */
+/* 657 */
/***/ (function(module, exports) {
/**
@@ -124084,7 +127170,7 @@ module.exports = 'postrender';
/***/ }),
-/* 651 */
+/* 658 */
/***/ (function(module, exports) {
/**
@@ -124110,7 +127196,57 @@ module.exports = 'prerender';
/***/ }),
-/* 652 */
+/* 659 */
+/***/ (function(module, exports) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+/**
+ * The Camera Rotate Complete Event.
+ *
+ * This event is dispatched by a Camera instance when the Rotate Effect completes.
+ *
+ * @event Phaser.Cameras.Scene2D.Events#ROTATE_COMPLETE
+ * @since 3.23.0
+ *
+ * @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.
+ */
+module.exports = 'camerarotatecomplete';
+
+
+/***/ }),
+/* 660 */
+/***/ (function(module, exports) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+/**
+ * The Camera Rotate Start Event.
+ *
+ * This event is dispatched by a Camera instance when the Rotate Effect starts.
+ *
+ * @event Phaser.Cameras.Scene2D.Events#ROTATE_START
+ * @since 3.23.0
+ *
+ * @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} destination - The destination value.
+ */
+module.exports = 'camerarotatestart';
+
+
+/***/ }),
+/* 661 */
/***/ (function(module, exports) {
/**
@@ -124134,7 +127270,7 @@ module.exports = 'camerashakecomplete';
/***/ }),
-/* 653 */
+/* 662 */
/***/ (function(module, exports) {
/**
@@ -124160,7 +127296,7 @@ module.exports = 'camerashakestart';
/***/ }),
-/* 654 */
+/* 663 */
/***/ (function(module, exports) {
/**
@@ -124184,7 +127320,7 @@ module.exports = 'camerazoomcomplete';
/***/ }),
-/* 655 */
+/* 664 */
/***/ (function(module, exports) {
/**
@@ -124210,7 +127346,7 @@ module.exports = 'camerazoomstart';
/***/ }),
-/* 656 */
+/* 665 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -124219,9 +127355,9 @@ module.exports = 'camerazoomstart';
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Clamp = __webpack_require__(22);
+var Clamp = __webpack_require__(17);
var Class = __webpack_require__(0);
-var Events = __webpack_require__(48);
+var Events = __webpack_require__(40);
/**
* @classdesc
@@ -124598,7 +127734,7 @@ module.exports = Fade;
/***/ }),
-/* 657 */
+/* 666 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -124607,9 +127743,9 @@ module.exports = Fade;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Clamp = __webpack_require__(22);
+var Clamp = __webpack_require__(17);
var Class = __webpack_require__(0);
-var Events = __webpack_require__(48);
+var Events = __webpack_require__(40);
/**
* @classdesc
@@ -124949,7 +128085,7 @@ module.exports = Flash;
/***/ }),
-/* 658 */
+/* 667 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -124958,10 +128094,10 @@ module.exports = Flash;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Clamp = __webpack_require__(22);
+var Clamp = __webpack_require__(17);
var Class = __webpack_require__(0);
-var EaseMap = __webpack_require__(166);
-var Events = __webpack_require__(48);
+var EaseMap = __webpack_require__(117);
+var Events = __webpack_require__(40);
var Vector2 = __webpack_require__(3);
/**
@@ -125274,7 +128410,7 @@ module.exports = Pan;
/***/ }),
-/* 659 */
+/* 668 */
/***/ (function(module, exports) {
/**
@@ -125305,7 +128441,7 @@ module.exports = In;
/***/ }),
-/* 660 */
+/* 669 */
/***/ (function(module, exports) {
/**
@@ -125336,7 +128472,7 @@ module.exports = Out;
/***/ }),
-/* 661 */
+/* 670 */
/***/ (function(module, exports) {
/**
@@ -125376,7 +128512,7 @@ module.exports = InOut;
/***/ }),
-/* 662 */
+/* 671 */
/***/ (function(module, exports) {
/**
@@ -125421,7 +128557,7 @@ module.exports = In;
/***/ }),
-/* 663 */
+/* 672 */
/***/ (function(module, exports) {
/**
@@ -125464,7 +128600,7 @@ module.exports = Out;
/***/ }),
-/* 664 */
+/* 673 */
/***/ (function(module, exports) {
/**
@@ -125528,7 +128664,7 @@ module.exports = InOut;
/***/ }),
-/* 665 */
+/* 674 */
/***/ (function(module, exports) {
/**
@@ -125556,7 +128692,7 @@ module.exports = In;
/***/ }),
-/* 666 */
+/* 675 */
/***/ (function(module, exports) {
/**
@@ -125584,7 +128720,7 @@ module.exports = Out;
/***/ }),
-/* 667 */
+/* 676 */
/***/ (function(module, exports) {
/**
@@ -125619,7 +128755,7 @@ module.exports = InOut;
/***/ }),
-/* 668 */
+/* 677 */
/***/ (function(module, exports) {
/**
@@ -125647,7 +128783,7 @@ module.exports = In;
/***/ }),
-/* 669 */
+/* 678 */
/***/ (function(module, exports) {
/**
@@ -125675,7 +128811,7 @@ module.exports = Out;
/***/ }),
-/* 670 */
+/* 679 */
/***/ (function(module, exports) {
/**
@@ -125710,7 +128846,7 @@ module.exports = InOut;
/***/ }),
-/* 671 */
+/* 680 */
/***/ (function(module, exports) {
/**
@@ -125765,7 +128901,7 @@ module.exports = In;
/***/ }),
-/* 672 */
+/* 681 */
/***/ (function(module, exports) {
/**
@@ -125820,7 +128956,7 @@ module.exports = Out;
/***/ }),
-/* 673 */
+/* 682 */
/***/ (function(module, exports) {
/**
@@ -125882,7 +129018,7 @@ module.exports = InOut;
/***/ }),
-/* 674 */
+/* 683 */
/***/ (function(module, exports) {
/**
@@ -125910,7 +129046,7 @@ module.exports = In;
/***/ }),
-/* 675 */
+/* 684 */
/***/ (function(module, exports) {
/**
@@ -125938,7 +129074,7 @@ module.exports = Out;
/***/ }),
-/* 676 */
+/* 685 */
/***/ (function(module, exports) {
/**
@@ -125973,7 +129109,7 @@ module.exports = InOut;
/***/ }),
-/* 677 */
+/* 686 */
/***/ (function(module, exports) {
/**
@@ -125985,7 +129121,7 @@ module.exports = InOut;
/**
* Linear easing (no variation).
*
- * @function Phaser.Math.Easing.Linear.Linear
+ * @function Phaser.Math.Easing.Linear
* @since 3.0.0
*
* @param {number} v - The value to be tweened.
@@ -126001,7 +129137,7 @@ module.exports = Linear;
/***/ }),
-/* 678 */
+/* 687 */
/***/ (function(module, exports) {
/**
@@ -126029,7 +129165,7 @@ module.exports = In;
/***/ }),
-/* 679 */
+/* 688 */
/***/ (function(module, exports) {
/**
@@ -126057,7 +129193,7 @@ module.exports = Out;
/***/ }),
-/* 680 */
+/* 689 */
/***/ (function(module, exports) {
/**
@@ -126092,7 +129228,7 @@ module.exports = InOut;
/***/ }),
-/* 681 */
+/* 690 */
/***/ (function(module, exports) {
/**
@@ -126120,7 +129256,7 @@ module.exports = In;
/***/ }),
-/* 682 */
+/* 691 */
/***/ (function(module, exports) {
/**
@@ -126148,7 +129284,7 @@ module.exports = Out;
/***/ }),
-/* 683 */
+/* 692 */
/***/ (function(module, exports) {
/**
@@ -126183,7 +129319,7 @@ module.exports = InOut;
/***/ }),
-/* 684 */
+/* 693 */
/***/ (function(module, exports) {
/**
@@ -126211,7 +129347,7 @@ module.exports = In;
/***/ }),
-/* 685 */
+/* 694 */
/***/ (function(module, exports) {
/**
@@ -126239,7 +129375,7 @@ module.exports = Out;
/***/ }),
-/* 686 */
+/* 695 */
/***/ (function(module, exports) {
/**
@@ -126274,7 +129410,7 @@ module.exports = InOut;
/***/ }),
-/* 687 */
+/* 696 */
/***/ (function(module, exports) {
/**
@@ -126313,7 +129449,7 @@ module.exports = In;
/***/ }),
-/* 688 */
+/* 697 */
/***/ (function(module, exports) {
/**
@@ -126352,7 +129488,7 @@ module.exports = Out;
/***/ }),
-/* 689 */
+/* 698 */
/***/ (function(module, exports) {
/**
@@ -126391,7 +129527,7 @@ module.exports = InOut;
/***/ }),
-/* 690 */
+/* 699 */
/***/ (function(module, exports) {
/**
@@ -126403,7 +129539,7 @@ module.exports = InOut;
/**
* Stepped easing.
*
- * @function Phaser.Math.Easing.Stepped.Stepped
+ * @function Phaser.Math.Easing.Stepped
* @since 3.0.0
*
* @param {number} v - The value to be tweened.
@@ -126433,7 +129569,7 @@ module.exports = Stepped;
/***/ }),
-/* 691 */
+/* 700 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -126442,9 +129578,9 @@ module.exports = Stepped;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Clamp = __webpack_require__(22);
+var Clamp = __webpack_require__(17);
var Class = __webpack_require__(0);
-var Events = __webpack_require__(48);
+var Events = __webpack_require__(40);
var Vector2 = __webpack_require__(3);
/**
@@ -126752,7 +129888,440 @@ module.exports = Shake;
/***/ }),
-/* 692 */
+/* 701 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author Jason Nicholls
+ * @copyright 2018 Photon Storm Ltd.
+ * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+ */
+
+var Clamp = __webpack_require__(17);
+var Class = __webpack_require__(0);
+var Events = __webpack_require__(40);
+var EaseMap = __webpack_require__(117);
+
+/**
+ * @classdesc
+ * A Camera Rotate effect.
+ *
+ * This effect will rotate the Camera so that the its viewport finishes at the given angle in radians,
+ * over the duration and with the ease specified.
+ *
+ * Camera rotation always takes place based on the Camera viewport. By default, rotation happens
+ * in the center of the viewport. You can adjust this with the `originX` and `originY` properties.
+ *
+ * Rotation influences the rendering of _all_ Game Objects visible by this Camera. However, it does not
+ * rotate the Camera viewport itself, which always remains an axis-aligned rectangle.
+ *
+ * Only the camera is rotates. None of the objects it is displaying are impacted, i.e. their positions do
+ * not change.
+ *
+ * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback,
+ * which is invoked each frame for the duration of the effect if required.
+ *
+ * @class RotateTo
+ * @memberof Phaser.Cameras.Scene2D.Effects
+ * @constructor
+ * @since 3.23.0
+ *
+ * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon.
+ */
+var RotateTo = new Class({
+
+ initialize:
+
+ function RotateTo (camera)
+ {
+ /**
+ * The Camera this effect belongs to.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#camera
+ * @type {Phaser.Cameras.Scene2D.Camera}
+ * @readonly
+ * @since 3.23.0
+ */
+ this.camera = camera;
+
+ /**
+ * Is this effect actively running?
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#isRunning
+ * @type {boolean}
+ * @readonly
+ * @default false
+ * @since 3.23.0
+ */
+ this.isRunning = false;
+
+ /**
+ * The duration of the effect, in milliseconds.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#duration
+ * @type {integer}
+ * @readonly
+ * @default 0
+ * @since 3.23.0
+ */
+ this.duration = 0;
+
+ /**
+ * The starting angle to rotate the camera from.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#source
+ * @type {number}
+ * @since 3.23.0
+ */
+ this.source = 0;
+
+ /**
+ * The constantly updated value based on the force.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#current
+ * @type {number}
+ * @since 3.23.0
+ */
+ this.current = 0;
+
+ /**
+ * The destination angle in radians to rotate the camera to.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#destination
+ * @type {number}
+ * @since 3.23.0
+ */
+ this.destination = 0;
+
+ /**
+ * The ease function to use during the Rotate.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#ease
+ * @type {function}
+ * @since 3.23.0
+ */
+ this.ease;
+
+ /**
+ * If this effect is running this holds the current percentage of the progress, a value between 0 and 1.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#progress
+ * @type {number}
+ * @since 3.23.0
+ */
+ this.progress = 0;
+
+ /**
+ * Effect elapsed timer.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#_elapsed
+ * @type {number}
+ * @private
+ * @since 3.23.0
+ */
+ this._elapsed = 0;
+
+ /**
+ * @callback CameraRotateCallback
+ *
+ * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera on which the effect is running.
+ * @param {number} progress - The progress of the effect. A value between 0 and 1.
+ * @param {number} angle - The Camera's new angle in radians.
+ */
+
+ /**
+ * This callback is invoked every frame for the duration of the effect.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#_onUpdate
+ * @type {?CameraRotateCallback}
+ * @private
+ * @default null
+ * @since 3.23.0
+ */
+ this._onUpdate;
+
+ /**
+ * On Complete callback scope.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#_onUpdateScope
+ * @type {any}
+ * @private
+ * @since 3.23.0
+ */
+ this._onUpdateScope;
+
+ /**
+ * The direction of the rotation.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#clockwise
+ * @type {boolean}
+ * @since 3.23.0
+ */
+ this.clockwise = true;
+
+ /**
+ * The shortest direction to the target rotation.
+ *
+ * @name Phaser.Cameras.Scene2D.Effects.RotateTo#shortestPath
+ * @type {boolean}
+ * @since 3.23.0
+ */
+ this.shortestPath = false;
+ },
+
+ /**
+ * This effect will scroll the Camera so that the center of its viewport finishes at the given angle,
+ * over the duration and with the ease specified.
+ *
+ * @method Phaser.Cameras.Scene2D.Effects.RotateTo#start
+ * @fires Phaser.Cameras.Scene2D.Events#ROTATE_START
+ * @fires Phaser.Cameras.Scene2D.Events#ROTATE_COMPLETE
+ * @since 3.23.0
+ *
+ * @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 {(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.
+ * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is,
+ * the current camera scroll x coordinate and the current camera scroll y coordinate.
+ * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.
+ *
+ * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started.
+ */
+ start: function (radians, shortestPath, duration, ease, force, callback, context)
+ {
+ if (duration === undefined) { duration = 1000; }
+ if (ease === undefined) { ease = EaseMap.Linear; }
+ if (force === undefined) { force = false; }
+ if (callback === undefined) { callback = null; }
+ if (context === undefined) { context = this.camera.scene; }
+ if (shortestPath === undefined) { shortestPath = false; }
+
+ this.shortestPath = shortestPath;
+
+ var tmpDestination = radians;
+
+ if (radians < 0)
+ {
+ tmpDestination = -1 * radians;
+ this.clockwise = false;
+ }
+ else
+ {
+ this.clockwise = true;
+ }
+
+ var maxRad = (360 * Math.PI) / 180;
+
+ tmpDestination = tmpDestination - (Math.floor(tmpDestination / maxRad) * maxRad);
+
+ var cam = this.camera;
+
+ if (!force && this.isRunning)
+ {
+ return cam;
+ }
+
+ this.isRunning = true;
+ this.duration = duration;
+ this.progress = 0;
+
+ // Starting from
+ this.source = cam.rotation;
+
+ // Destination
+ this.destination = tmpDestination;
+
+ // Using this ease
+ if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease))
+ {
+ this.ease = EaseMap[ease];
+ }
+ else if (typeof ease === 'function')
+ {
+ this.ease = ease;
+ }
+
+ this._elapsed = 0;
+
+ this._onUpdate = callback;
+ this._onUpdateScope = context;
+
+
+ if (this.shortestPath)
+ {
+ // The shortest path is true so calculate the quickest direction
+ var cwDist = 0;
+ var acwDist = 0;
+
+ if (this.destination > this.source)
+ {
+ cwDist = Math.abs(this.destination - this.source);
+ }
+ else
+ {
+ cwDist = (Math.abs(this.destination + maxRad) - this.source);
+ }
+
+ if (this.source > this.destination)
+ {
+ acwDist = Math.abs(this.source - this.destination);
+ }
+ else
+ {
+ acwDist = (Math.abs(this.source + maxRad) - this.destination);
+ }
+
+ if (cwDist < acwDist)
+ {
+ this.clockwise = true;
+ }
+ else if (cwDist > acwDist)
+ {
+ this.clockwise = false;
+ }
+ }
+
+ this.camera.emit(Events.ROTATE_START, this.camera, this, duration, tmpDestination);
+
+ return cam;
+ },
+
+ /**
+ * The main update loop for this effect. Called automatically by the Camera.
+ *
+ * @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} delta - The delta time, in ms, elapsed since the last frame.
+ */
+ update: function (time, delta)
+ {
+ if (!this.isRunning)
+ {
+ return;
+ }
+
+ this._elapsed += delta;
+
+ var progress = Clamp(this._elapsed / this.duration, 0, 1);
+
+ this.progress = progress;
+
+ var cam = this.camera;
+
+ if (this._elapsed < this.duration)
+ {
+ var v = this.ease(progress);
+
+ this.current = cam.rotation;
+ var distance = 0;
+ var maxRad = (360 * Math.PI) / 180;
+ var target = this.destination;
+ var current = this.current;
+
+ if (this.clockwise === false)
+ {
+ target = this.current;
+ current = this.destination;
+ }
+
+ if (target >= current)
+ {
+ distance = Math.abs(target - current);
+ }
+ else
+ {
+ distance = (Math.abs(target + maxRad) - current);
+ }
+
+ var r = 0;
+
+ if (this.clockwise)
+ {
+ r = (cam.rotation + (distance * v));
+ }
+ else
+ {
+ r = (cam.rotation - (distance * v));
+ }
+
+ cam.rotation = r;
+
+ if (this._onUpdate)
+ {
+ this._onUpdate.call(this._onUpdateScope, cam, progress, r);
+ }
+ }
+ else
+ {
+ cam.rotation = this.destination;
+
+ if (this._onUpdate)
+ {
+ this._onUpdate.call(this._onUpdateScope, cam, progress, this.destination);
+ }
+
+ this.effectComplete();
+ }
+ },
+
+ /**
+ * Called internally when the effect completes.
+ *
+ * @method Phaser.Cameras.Scene2D.Effects.RotateTo#effectComplete
+ * @since 3.23.0
+ */
+ effectComplete: function ()
+ {
+ this._onUpdate = null;
+ this._onUpdateScope = null;
+
+ this.isRunning = false;
+
+ this.camera.emit(Events.ROTATE_COMPLETE, this.camera, this);
+ },
+
+ /**
+ * Resets this camera effect.
+ * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event.
+ *
+ * @method Phaser.Cameras.Scene2D.Effects.RotateTo#reset
+ * @since 3.23.0
+ */
+ reset: function ()
+ {
+ this.isRunning = false;
+
+ this._onUpdate = null;
+ this._onUpdateScope = null;
+ },
+
+ /**
+ * Destroys this effect, releasing it from the Camera.
+ *
+ * @method Phaser.Cameras.Scene2D.Effects.RotateTo#destroy
+ * @since 3.23.0
+ */
+ destroy: function ()
+ {
+ this.reset();
+
+ this.camera = null;
+ this.source = null;
+ this.destination = null;
+ }
+
+});
+
+module.exports = RotateTo;
+
+
+/***/ }),
+/* 702 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -126761,10 +130330,10 @@ module.exports = Shake;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Clamp = __webpack_require__(22);
+var Clamp = __webpack_require__(17);
var Class = __webpack_require__(0);
-var EaseMap = __webpack_require__(166);
-var Events = __webpack_require__(48);
+var EaseMap = __webpack_require__(117);
+var Events = __webpack_require__(40);
/**
* @classdesc
@@ -127045,7 +130614,7 @@ module.exports = Zoom;
/***/ }),
-/* 693 */
+/* 703 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -127054,13 +130623,13 @@ module.exports = Zoom;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Camera = __webpack_require__(290);
+var Camera = __webpack_require__(297);
var Class = __webpack_require__(0);
var GetFastValue = __webpack_require__(2);
var PluginCache = __webpack_require__(23);
-var RectangleContains = __webpack_require__(47);
+var RectangleContains = __webpack_require__(48);
var ScaleEvents = __webpack_require__(92);
-var SceneEvents = __webpack_require__(19);
+var SceneEvents = __webpack_require__(22);
/**
* @classdesc
@@ -127445,7 +131014,7 @@ var CameraManager = new Class({
*
* @param {(Phaser.Types.Cameras.Scene2D.CameraConfig|Phaser.Types.Cameras.Scene2D.CameraConfig[])} config - A Camera configuration object, or an array of them, to be added to this Camera Manager.
*
- * @return {Phaser.Cameras.Scene2D.CameraManager} This Camera Manager instance.
+ * @return {this} This Camera Manager instance.
*/
fromJSON: function (config)
{
@@ -127793,7 +131362,7 @@ module.exports = CameraManager;
/***/ }),
-/* 694 */
+/* 704 */
/***/ (function(module, exports) {
/**
@@ -127812,7 +131381,7 @@ module.exports = 'enterfullscreen';
/***/ }),
-/* 695 */
+/* 705 */
/***/ (function(module, exports) {
/**
@@ -127831,7 +131400,7 @@ module.exports = 'fullscreenfailed';
/***/ }),
-/* 696 */
+/* 706 */
/***/ (function(module, exports) {
/**
@@ -127850,7 +131419,7 @@ module.exports = 'fullscreenunsupported';
/***/ }),
-/* 697 */
+/* 707 */
/***/ (function(module, exports) {
/**
@@ -127870,7 +131439,7 @@ module.exports = 'leavefullscreen';
/***/ }),
-/* 698 */
+/* 708 */
/***/ (function(module, exports) {
/**
@@ -127891,7 +131460,7 @@ module.exports = 'orientationchange';
/***/ }),
-/* 699 */
+/* 709 */
/***/ (function(module, exports) {
/**
@@ -127922,7 +131491,7 @@ module.exports = 'resize';
/***/ }),
-/* 700 */
+/* 710 */
/***/ (function(module, exports) {
/**
@@ -127947,7 +131516,7 @@ module.exports = 'boot';
/***/ }),
-/* 701 */
+/* 711 */
/***/ (function(module, exports) {
/**
@@ -127976,7 +131545,7 @@ module.exports = 'create';
/***/ }),
-/* 702 */
+/* 712 */
/***/ (function(module, exports) {
/**
@@ -128003,7 +131572,7 @@ module.exports = 'destroy';
/***/ }),
-/* 703 */
+/* 713 */
/***/ (function(module, exports) {
/**
@@ -128030,7 +131599,7 @@ module.exports = 'pause';
/***/ }),
-/* 704 */
+/* 714 */
/***/ (function(module, exports) {
/**
@@ -128067,7 +131636,7 @@ module.exports = 'postupdate';
/***/ }),
-/* 705 */
+/* 715 */
/***/ (function(module, exports) {
/**
@@ -128104,7 +131673,7 @@ module.exports = 'preupdate';
/***/ }),
-/* 706 */
+/* 716 */
/***/ (function(module, exports) {
/**
@@ -128132,7 +131701,7 @@ module.exports = 'ready';
/***/ }),
-/* 707 */
+/* 717 */
/***/ (function(module, exports) {
/**
@@ -128168,7 +131737,7 @@ module.exports = 'render';
/***/ }),
-/* 708 */
+/* 718 */
/***/ (function(module, exports) {
/**
@@ -128195,7 +131764,7 @@ module.exports = 'resume';
/***/ }),
-/* 709 */
+/* 719 */
/***/ (function(module, exports) {
/**
@@ -128225,7 +131794,7 @@ module.exports = 'shutdown';
/***/ }),
-/* 710 */
+/* 720 */
/***/ (function(module, exports) {
/**
@@ -128252,7 +131821,7 @@ module.exports = 'sleep';
/***/ }),
-/* 711 */
+/* 721 */
/***/ (function(module, exports) {
/**
@@ -128277,7 +131846,7 @@ module.exports = 'start';
/***/ }),
-/* 712 */
+/* 722 */
/***/ (function(module, exports) {
/**
@@ -128313,7 +131882,7 @@ module.exports = 'transitioncomplete';
/***/ }),
-/* 713 */
+/* 723 */
/***/ (function(module, exports) {
/**
@@ -128350,7 +131919,7 @@ module.exports = 'transitioninit';
/***/ }),
-/* 714 */
+/* 724 */
/***/ (function(module, exports) {
/**
@@ -128384,7 +131953,7 @@ module.exports = 'transitionout';
/***/ }),
-/* 715 */
+/* 725 */
/***/ (function(module, exports) {
/**
@@ -128424,7 +131993,7 @@ module.exports = 'transitionstart';
/***/ }),
-/* 716 */
+/* 726 */
/***/ (function(module, exports) {
/**
@@ -128459,7 +132028,7 @@ module.exports = 'transitionwake';
/***/ }),
-/* 717 */
+/* 727 */
/***/ (function(module, exports) {
/**
@@ -128496,7 +132065,7 @@ module.exports = 'update';
/***/ }),
-/* 718 */
+/* 728 */
/***/ (function(module, exports) {
/**
@@ -128523,7 +132092,7 @@ module.exports = 'wake';
/***/ }),
-/* 719 */
+/* 729 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -128538,18 +132107,18 @@ module.exports = 'wake';
module.exports = {
- Config: __webpack_require__(311),
- CreateRenderer: __webpack_require__(334),
- DebugHeader: __webpack_require__(336),
- Events: __webpack_require__(18),
- TimeStep: __webpack_require__(337),
- VisibilityHandler: __webpack_require__(339)
+ Config: __webpack_require__(318),
+ CreateRenderer: __webpack_require__(340),
+ DebugHeader: __webpack_require__(342),
+ Events: __webpack_require__(20),
+ TimeStep: __webpack_require__(343),
+ VisibilityHandler: __webpack_require__(345)
};
/***/ }),
-/* 720 */
+/* 730 */
/***/ (function(module, exports) {
// shim for using process in browser
@@ -128739,7 +132308,7 @@ process.umask = function() { return 0; };
/***/ }),
-/* 721 */
+/* 731 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -128748,7 +132317,7 @@ process.umask = function() { return 0; };
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Browser = __webpack_require__(117);
+var Browser = __webpack_require__(120);
/**
* Determines the input support of the browser running this Phaser Game instance.
@@ -128814,7 +132383,7 @@ module.exports = init();
/***/ }),
-/* 722 */
+/* 732 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -128823,7 +132392,7 @@ module.exports = init();
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Browser = __webpack_require__(117);
+var Browser = __webpack_require__(120);
/**
* Determines the audio playback capabilities of the device running this Phaser Game instance.
@@ -128939,7 +132508,7 @@ module.exports = init();
/***/ }),
-/* 723 */
+/* 733 */
/***/ (function(module, exports) {
/**
@@ -129026,7 +132595,7 @@ module.exports = init();
/***/ }),
-/* 724 */
+/* 734 */
/***/ (function(module, exports) {
/**
@@ -129130,7 +132699,7 @@ module.exports = init();
/***/ }),
-/* 725 */
+/* 735 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129145,54 +132714,25 @@ module.exports = init();
module.exports = {
- Between: __webpack_require__(314),
- BetweenPoints: __webpack_require__(726),
- BetweenPointsY: __webpack_require__(727),
- BetweenY: __webpack_require__(728),
- CounterClockwise: __webpack_require__(729),
- Normalize: __webpack_require__(315),
- Reverse: __webpack_require__(730),
- RotateTo: __webpack_require__(731),
- ShortestBetween: __webpack_require__(732),
- Wrap: __webpack_require__(232),
- WrapDegrees: __webpack_require__(233)
+ Between: __webpack_require__(321),
+ BetweenPoints: __webpack_require__(322),
+ BetweenPointsY: __webpack_require__(736),
+ BetweenY: __webpack_require__(737),
+ CounterClockwise: __webpack_require__(738),
+ Normalize: __webpack_require__(323),
+ Random: __webpack_require__(739),
+ RandomDegrees: __webpack_require__(740),
+ Reverse: __webpack_require__(741),
+ RotateTo: __webpack_require__(742),
+ ShortestBetween: __webpack_require__(743),
+ Wrap: __webpack_require__(241),
+ WrapDegrees: __webpack_require__(242)
};
/***/ }),
-/* 726 */
-/***/ (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 (point1.x, point1.y) -> (point2.x, point2.y).
- *
- * Calculates the angle of the vector from the first point to the second point.
- *
- * @function Phaser.Math.Angle.BetweenPoints
- * @since 3.0.0
- *
- * @param {(Phaser.Geom.Point|object)} point1 - The first point.
- * @param {(Phaser.Geom.Point|object)} point2 - The second point.
- *
- * @return {number} The angle in radians.
- */
-var BetweenPoints = function (point1, point2)
-{
- return Math.atan2(point2.y - point1.y, point2.x - point1.x);
-};
-
-module.exports = BetweenPoints;
-
-
-/***/ }),
-/* 727 */
+/* 736 */
/***/ (function(module, exports) {
/**
@@ -129210,8 +132750,8 @@ module.exports = BetweenPoints;
* @function Phaser.Math.Angle.BetweenPointsY
* @since 3.0.0
*
- * @param {(Phaser.Geom.Point|object)} point1 - The first point.
- * @param {(Phaser.Geom.Point|object)} point2 - The second point.
+ * @param {Phaser.Types.Math.Vector2Like} point1 - The first point.
+ * @param {Phaser.Types.Math.Vector2Like} point2 - The second point.
*
* @return {number} The angle in radians.
*/
@@ -129224,7 +132764,7 @@ module.exports = BetweenPointsY;
/***/ }),
-/* 728 */
+/* 737 */
/***/ (function(module, exports) {
/**
@@ -129258,7 +132798,7 @@ module.exports = BetweenY;
/***/ }),
-/* 729 */
+/* 738 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129303,7 +132843,65 @@ module.exports = CounterClockwise;
/***/ }),
-/* 730 */
+/* 739 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author Richard Davey
+ * @author @samme
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+var FloatBetween = __webpack_require__(121);
+
+/**
+ * Returns a random angle in the range [-pi, pi].
+ *
+ * @function Phaser.Math.Angle.Random
+ * @since 3.23.0
+ *
+ * @return {number} The angle, in radians.
+ */
+var Random = function ()
+{
+ return FloatBetween(-Math.PI, Math.PI);
+};
+
+module.exports = Random;
+
+
+/***/ }),
+/* 740 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author Richard Davey
+ * @author @samme
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+var FloatBetween = __webpack_require__(121);
+
+/**
+ * Returns a random angle in the range [-180, 180].
+ *
+ * @function Phaser.Math.Angle.RandomDegrees
+ * @since 3.23.0
+ *
+ * @return {number} The angle, in degrees.
+ */
+var RandomDegrees = function ()
+{
+ return FloatBetween(-180, 180);
+};
+
+module.exports = RandomDegrees;
+
+
+/***/ }),
+/* 741 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129312,7 +132910,7 @@ module.exports = CounterClockwise;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Normalize = __webpack_require__(315);
+var Normalize = __webpack_require__(323);
/**
* Reverse the given angle.
@@ -129333,7 +132931,7 @@ module.exports = Reverse;
/***/ }),
-/* 731 */
+/* 742 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129400,7 +132998,7 @@ module.exports = RotateTo;
/***/ }),
-/* 732 */
+/* 743 */
/***/ (function(module, exports) {
/**
@@ -129449,7 +133047,7 @@ module.exports = ShortestBetween;
/***/ }),
-/* 733 */
+/* 744 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129464,51 +133062,19 @@ module.exports = ShortestBetween;
module.exports = {
- Between: __webpack_require__(53),
- BetweenPoints: __webpack_require__(734),
- BetweenPointsSquared: __webpack_require__(735),
- Chebyshev: __webpack_require__(736),
- Power: __webpack_require__(737),
- Snake: __webpack_require__(738),
- Squared: __webpack_require__(316)
+ Between: __webpack_require__(54),
+ BetweenPoints: __webpack_require__(324),
+ BetweenPointsSquared: __webpack_require__(745),
+ Chebyshev: __webpack_require__(746),
+ Power: __webpack_require__(747),
+ Snake: __webpack_require__(748),
+ Squared: __webpack_require__(325)
};
/***/ }),
-/* 734 */
-/***/ (function(module, exports) {
-
-/**
- * @author samme
- * @copyright 2020 Photon Storm Ltd.
- * @license {@link https://opensource.org/licenses/MIT|MIT License}
- */
-
-/**
- * Calculate the distance between two points.
- *
- * @function Phaser.Math.Distance.BetweenPoints
- * @since 3.22.0
- *
- * @param {Phaser.Types.Math.Vector2Like} a - The first point.
- * @param {Phaser.Types.Math.Vector2Like} b - The second point.
- *
- * @return {number} The distance between the points.
- */
-var DistanceBetweenPoints = function (a, b)
-{
- var dx = a.x - b.x;
- var dy = a.y - b.y;
-
- return Math.sqrt(dx * dx + dy * dy);
-};
-
-module.exports = DistanceBetweenPoints;
-
-
-/***/ }),
-/* 735 */
+/* 745 */
/***/ (function(module, exports) {
/**
@@ -129540,7 +133106,7 @@ module.exports = DistanceBetweenPointsSquared;
/***/ }),
-/* 736 */
+/* 746 */
/***/ (function(module, exports) {
/**
@@ -129574,7 +133140,7 @@ module.exports = ChebyshevDistance;
/***/ }),
-/* 737 */
+/* 747 */
/***/ (function(module, exports) {
/**
@@ -129608,7 +133174,7 @@ module.exports = DistancePower;
/***/ }),
-/* 738 */
+/* 748 */
/***/ (function(module, exports) {
/**
@@ -129642,7 +133208,7 @@ module.exports = SnakeDistance;
/***/ }),
-/* 739 */
+/* 749 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129657,24 +133223,24 @@ module.exports = SnakeDistance;
module.exports = {
- Back: __webpack_require__(299),
- Bounce: __webpack_require__(300),
- Circular: __webpack_require__(301),
- Cubic: __webpack_require__(302),
- Elastic: __webpack_require__(303),
- Expo: __webpack_require__(304),
- Linear: __webpack_require__(305),
- Quadratic: __webpack_require__(306),
- Quartic: __webpack_require__(307),
- Quintic: __webpack_require__(308),
- Sine: __webpack_require__(309),
- Stepped: __webpack_require__(310)
+ Back: __webpack_require__(306),
+ Bounce: __webpack_require__(307),
+ Circular: __webpack_require__(308),
+ Cubic: __webpack_require__(309),
+ Elastic: __webpack_require__(310),
+ Expo: __webpack_require__(311),
+ Linear: __webpack_require__(312),
+ Quadratic: __webpack_require__(313),
+ Quartic: __webpack_require__(314),
+ Quintic: __webpack_require__(315),
+ Sine: __webpack_require__(316),
+ Stepped: __webpack_require__(317)
};
/***/ }),
-/* 740 */
+/* 750 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129689,17 +133255,17 @@ module.exports = {
module.exports = {
- Ceil: __webpack_require__(741),
- Equal: __webpack_require__(144),
- Floor: __webpack_require__(742),
- GreaterThan: __webpack_require__(317),
- LessThan: __webpack_require__(318)
+ Ceil: __webpack_require__(751),
+ Equal: __webpack_require__(107),
+ Floor: __webpack_require__(752),
+ GreaterThan: __webpack_require__(326),
+ LessThan: __webpack_require__(327)
};
/***/ }),
-/* 741 */
+/* 751 */
/***/ (function(module, exports) {
/**
@@ -129730,7 +133296,7 @@ module.exports = Ceil;
/***/ }),
-/* 742 */
+/* 752 */
/***/ (function(module, exports) {
/**
@@ -129761,7 +133327,7 @@ module.exports = Floor;
/***/ }),
-/* 743 */
+/* 753 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129776,19 +133342,19 @@ module.exports = Floor;
module.exports = {
- Bezier: __webpack_require__(744),
- CatmullRom: __webpack_require__(745),
- CubicBezier: __webpack_require__(321),
- Linear: __webpack_require__(746),
- QuadraticBezier: __webpack_require__(322),
- SmoothStep: __webpack_require__(323),
- SmootherStep: __webpack_require__(747)
+ Bezier: __webpack_require__(754),
+ CatmullRom: __webpack_require__(755),
+ CubicBezier: __webpack_require__(330),
+ Linear: __webpack_require__(756),
+ QuadraticBezier: __webpack_require__(331),
+ SmoothStep: __webpack_require__(332),
+ SmootherStep: __webpack_require__(757)
};
/***/ }),
-/* 744 */
+/* 754 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129797,7 +133363,7 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Bernstein = __webpack_require__(319);
+var Bernstein = __webpack_require__(328);
/**
* A bezier interpolation method.
@@ -129827,7 +133393,7 @@ module.exports = BezierInterpolation;
/***/ }),
-/* 745 */
+/* 755 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129836,7 +133402,7 @@ module.exports = BezierInterpolation;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CatmullRom = __webpack_require__(169);
+var CatmullRom = __webpack_require__(176);
/**
* A Catmull-Rom interpolation method.
@@ -129884,7 +133450,7 @@ module.exports = CatmullRomInterpolation;
/***/ }),
-/* 746 */
+/* 756 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129893,7 +133459,7 @@ module.exports = CatmullRomInterpolation;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Linear = __webpack_require__(115);
+var Linear = __webpack_require__(118);
/**
* A linear interpolation method.
@@ -129931,7 +133497,7 @@ module.exports = LinearInterpolation;
/***/ }),
-/* 747 */
+/* 757 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129940,7 +133506,7 @@ module.exports = LinearInterpolation;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var SmootherStep = __webpack_require__(157);
+var SmootherStep = __webpack_require__(165);
/**
* A Smoother Step interpolation method.
@@ -129964,7 +133530,7 @@ module.exports = SmootherStepInterpolation;
/***/ }),
-/* 748 */
+/* 758 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -129979,15 +133545,15 @@ module.exports = SmootherStepInterpolation;
module.exports = {
- GetNext: __webpack_require__(324),
- IsSize: __webpack_require__(118),
- IsValue: __webpack_require__(749)
+ GetNext: __webpack_require__(333),
+ IsSize: __webpack_require__(122),
+ IsValue: __webpack_require__(759)
};
/***/ }),
-/* 749 */
+/* 759 */
/***/ (function(module, exports) {
/**
@@ -130015,7 +133581,7 @@ module.exports = IsValuePowerOfTwo;
/***/ }),
-/* 750 */
+/* 760 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -130030,15 +133596,15 @@ module.exports = IsValuePowerOfTwo;
module.exports = {
- Ceil: __webpack_require__(325),
+ Ceil: __webpack_require__(334),
Floor: __webpack_require__(93),
- To: __webpack_require__(751)
+ To: __webpack_require__(761)
};
/***/ }),
-/* 751 */
+/* 761 */
/***/ (function(module, exports) {
/**
@@ -130081,7 +133647,7 @@ module.exports = SnapTo;
/***/ }),
-/* 752 */
+/* 762 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -130591,7 +134157,7 @@ module.exports = RandomDataGenerator;
/***/ }),
-/* 753 */
+/* 763 */
/***/ (function(module, exports) {
/**
@@ -130626,7 +134192,7 @@ module.exports = Average;
/***/ }),
-/* 754 */
+/* 764 */
/***/ (function(module, exports) {
/**
@@ -130663,7 +134229,7 @@ module.exports = CeilTo;
/***/ }),
-/* 755 */
+/* 765 */
/***/ (function(module, exports) {
/**
@@ -130692,7 +134258,7 @@ module.exports = Difference;
/***/ }),
-/* 756 */
+/* 766 */
/***/ (function(module, exports) {
/**
@@ -130729,7 +134295,7 @@ module.exports = FloorTo;
/***/ }),
-/* 757 */
+/* 767 */
/***/ (function(module, exports) {
/**
@@ -130762,7 +134328,7 @@ module.exports = GetSpeed;
/***/ }),
-/* 758 */
+/* 768 */
/***/ (function(module, exports) {
/**
@@ -130793,7 +134359,7 @@ module.exports = IsEven;
/***/ }),
-/* 759 */
+/* 769 */
/***/ (function(module, exports) {
/**
@@ -130822,7 +134388,7 @@ module.exports = IsEvenStrict;
/***/ }),
-/* 760 */
+/* 770 */
/***/ (function(module, exports) {
/**
@@ -130852,7 +134418,7 @@ module.exports = MaxAdd;
/***/ }),
-/* 761 */
+/* 771 */
/***/ (function(module, exports) {
/**
@@ -130882,7 +134448,7 @@ module.exports = MinSub;
/***/ }),
-/* 762 */
+/* 772 */
/***/ (function(module, exports) {
/**
@@ -130941,7 +134507,7 @@ module.exports = Percent;
/***/ }),
-/* 763 */
+/* 773 */
/***/ (function(module, exports) {
/**
@@ -130981,7 +134547,7 @@ module.exports = RandomXY;
/***/ }),
-/* 764 */
+/* 774 */
/***/ (function(module, exports) {
/**
@@ -131020,7 +134586,7 @@ module.exports = RandomXYZ;
/***/ }),
-/* 765 */
+/* 775 */
/***/ (function(module, exports) {
/**
@@ -131057,7 +134623,44 @@ module.exports = RandomXYZW;
/***/ }),
-/* 766 */
+/* 776 */
+/***/ (function(module, exports) {
+
+/**
+ * @author samme
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+/**
+ * Position a `point` at the given `angle` and `distance` to (`x`, `y`).
+ *
+ * @function Phaser.Math.RotateTo
+ * @since 3.24.0
+ *
+ * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return]
+ *
+ * @param {Phaser.Types.Math.Vector2Like} point - The point to be positioned.
+ * @param {number} x - The horizontal coordinate to position from.
+ * @param {number} y - The vertical coordinate to position from.
+ * @param {number} angle - The angle of rotation in radians.
+ * @param {number} distance - The distance from (x, y) to place the point at.
+ *
+ * @return {Phaser.Types.Math.Vector2Like} The given point.
+ */
+var RotateTo = function (point, x, y, angle, distance)
+{
+ point.x = x + (distance * Math.cos(angle));
+ point.y = y + (distance * Math.sin(angle));
+
+ return point;
+};
+
+module.exports = RotateTo;
+
+
+/***/ }),
+/* 777 */
/***/ (function(module, exports) {
/**
@@ -131109,7 +134712,7 @@ module.exports = RoundTo;
/***/ }),
-/* 767 */
+/* 778 */
/***/ (function(module, exports) {
/**
@@ -131162,7 +134765,7 @@ module.exports = SinCosTableGenerator;
/***/ }),
-/* 768 */
+/* 779 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -131220,7 +134823,7 @@ module.exports = ToXY;
/***/ }),
-/* 769 */
+/* 780 */
/***/ (function(module, exports) {
/**
@@ -131250,7 +134853,7 @@ module.exports = Within;
/***/ }),
-/* 770 */
+/* 781 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -131259,9 +134862,9 @@ module.exports = Within;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Vector3 = __webpack_require__(172);
-var Matrix4 = __webpack_require__(332);
-var Quaternion = __webpack_require__(333);
+var Vector3 = __webpack_require__(94);
+var Matrix4 = __webpack_require__(338);
+var Quaternion = __webpack_require__(339);
var tmpMat4 = new Matrix4();
var tmpQuat = new Quaternion();
@@ -131298,7 +134901,7 @@ module.exports = RotateVec3;
/***/ }),
-/* 771 */
+/* 782 */
/***/ (function(module, exports) {
/**
@@ -131324,7 +134927,7 @@ module.exports = 'addtexture';
/***/ }),
-/* 772 */
+/* 783 */
/***/ (function(module, exports) {
/**
@@ -131350,7 +134953,7 @@ module.exports = 'onerror';
/***/ }),
-/* 773 */
+/* 784 */
/***/ (function(module, exports) {
/**
@@ -131379,7 +134982,7 @@ module.exports = 'onload';
/***/ }),
-/* 774 */
+/* 785 */
/***/ (function(module, exports) {
/**
@@ -131402,7 +135005,7 @@ module.exports = 'ready';
/***/ }),
-/* 775 */
+/* 786 */
/***/ (function(module, exports) {
/**
@@ -131430,7 +135033,7 @@ module.exports = 'removetexture';
/***/ }),
-/* 776 */
+/* 787 */
/***/ (function(module, exports) {
module.exports = [
@@ -131466,7 +135069,7 @@ module.exports = [
/***/ }),
-/* 777 */
+/* 788 */
/***/ (function(module, exports) {
module.exports = [
@@ -131485,7 +135088,7 @@ module.exports = [
/***/ }),
-/* 778 */
+/* 789 */
/***/ (function(module, exports) {
module.exports = [
@@ -131536,15 +135139,15 @@ module.exports = [
' }',
'',
' vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);',
- ' gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);',
'',
+ ' gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);',
'}',
''
].join('\n');
/***/ }),
-/* 779 */
+/* 790 */
/***/ (function(module, exports) {
module.exports = [
@@ -131552,15 +135155,19 @@ module.exports = [
'',
'precision mediump float;',
'',
- 'uniform sampler2D uMainSampler;',
+ 'uniform sampler2D uMainSampler[%count%];',
'',
'varying vec2 outTexCoord;',
+ 'varying float outTexId;',
'varying float outTintEffect;',
'varying vec4 outTint;',
'',
'void main()',
'{',
- ' vec4 texture = texture2D(uMainSampler, outTexCoord);',
+ ' vec4 texture;',
+ '',
+ ' %forloop%',
+ '',
' vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);',
' vec4 color = texture;',
'',
@@ -131588,7 +135195,7 @@ module.exports = [
/***/ }),
-/* 780 */
+/* 791 */
/***/ (function(module, exports) {
module.exports = [
@@ -131602,10 +135209,12 @@ module.exports = [
'',
'attribute vec2 inPosition;',
'attribute vec2 inTexCoord;',
+ 'attribute float inTexId;',
'attribute float inTintEffect;',
'attribute vec4 inTint;',
'',
'varying vec2 outTexCoord;',
+ 'varying float outTexId;',
'varying float outTintEffect;',
'varying vec4 outTint;',
'',
@@ -131614,6 +135223,7 @@ module.exports = [
' gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);',
'',
' outTexCoord = inTexCoord;',
+ ' outTexId = inTexId;',
' outTint = inTint;',
' outTintEffect = inTintEffect;',
'}',
@@ -131623,7 +135233,7 @@ module.exports = [
/***/ }),
-/* 781 */
+/* 792 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -131638,14 +135248,14 @@ module.exports = [
module.exports = {
- GenerateTexture: __webpack_require__(340),
- Palettes: __webpack_require__(782)
+ GenerateTexture: __webpack_require__(346),
+ Palettes: __webpack_require__(793)
};
/***/ }),
-/* 782 */
+/* 793 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -131660,17 +135270,17 @@ module.exports = {
module.exports = {
- ARNE16: __webpack_require__(341),
- C64: __webpack_require__(783),
- CGA: __webpack_require__(784),
- JMP: __webpack_require__(785),
- MSX: __webpack_require__(786)
+ ARNE16: __webpack_require__(347),
+ C64: __webpack_require__(794),
+ CGA: __webpack_require__(795),
+ JMP: __webpack_require__(796),
+ MSX: __webpack_require__(797)
};
/***/ }),
-/* 783 */
+/* 794 */
/***/ (function(module, exports) {
/**
@@ -131708,7 +135318,7 @@ module.exports = {
/***/ }),
-/* 784 */
+/* 795 */
/***/ (function(module, exports) {
/**
@@ -131746,7 +135356,7 @@ module.exports = {
/***/ }),
-/* 785 */
+/* 796 */
/***/ (function(module, exports) {
/**
@@ -131784,7 +135394,7 @@ module.exports = {
/***/ }),
-/* 786 */
+/* 797 */
/***/ (function(module, exports) {
/**
@@ -131822,7 +135432,7 @@ module.exports = {
/***/ }),
-/* 787 */
+/* 798 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -131836,19 +135446,19 @@ module.exports = {
*/
module.exports = {
- Path: __webpack_require__(788),
+ Path: __webpack_require__(799),
- CubicBezier: __webpack_require__(342),
- Curve: __webpack_require__(80),
- Ellipse: __webpack_require__(343),
- Line: __webpack_require__(344),
- QuadraticBezier: __webpack_require__(345),
- Spline: __webpack_require__(346)
+ CubicBezier: __webpack_require__(348),
+ Curve: __webpack_require__(81),
+ Ellipse: __webpack_require__(349),
+ Line: __webpack_require__(350),
+ QuadraticBezier: __webpack_require__(351),
+ Spline: __webpack_require__(352)
};
/***/ }),
-/* 788 */
+/* 799 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -131860,14 +135470,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__(342);
-var EllipseCurve = __webpack_require__(343);
+var CubicBezierCurve = __webpack_require__(348);
+var EllipseCurve = __webpack_require__(349);
var GameObjectFactory = __webpack_require__(5);
-var LineCurve = __webpack_require__(344);
-var MovePathTo = __webpack_require__(789);
-var QuadraticBezierCurve = __webpack_require__(345);
-var Rectangle = __webpack_require__(11);
-var SplineCurve = __webpack_require__(346);
+var LineCurve = __webpack_require__(350);
+var MovePathTo = __webpack_require__(800);
+var QuadraticBezierCurve = __webpack_require__(351);
+var Rectangle = __webpack_require__(9);
+var SplineCurve = __webpack_require__(352);
var Vector2 = __webpack_require__(3);
var MATH_CONST = __webpack_require__(13);
@@ -131990,7 +135600,7 @@ var Path = new Class({
*
* @param {Phaser.Curves.Curve} curve - The Curve to append.
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
add: function (curve)
{
@@ -132009,7 +135619,7 @@ var Path = new Class({
* @param {boolean} [clockwise=false] - `true` to create a clockwise circle as opposed to a counter-clockwise circle.
* @param {number} [rotation=0] - The rotation of the circle in degrees.
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
circleTo: function (radius, clockwise, rotation)
{
@@ -132028,7 +135638,7 @@ var Path = new Class({
* @method Phaser.Curves.Path#closePath
* @since 3.0.0
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
closePath: function ()
{
@@ -132058,7 +135668,7 @@ var Path = new Class({
* @param {number} [control2X] - The x coordinate of the second control point. Not used if Vector2s are provided as the first 3 arguments.
* @param {number} [control2Y] - The y coordinate of the second control point. Not used if Vector2s are provided as the first 3 arguments.
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
cubicBezierTo: function (x, y, control1X, control1Y, control2X, control2Y)
{
@@ -132097,7 +135707,7 @@ var Path = new Class({
* @param {number} [controlX] - If `x` is not a `Vector2`, the X coordinate of the first control point.
* @param {number} [controlY] - If `x` is not a `Vector2`, the Y coordinate of the first control point.
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
quadraticBezierTo: function (x, y, controlX, controlY)
{
@@ -132163,7 +135773,7 @@ var Path = new Class({
* @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.
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
ellipseTo: function (xRadius, yRadius, startAngle, endAngle, clockwise, rotation)
{
@@ -132192,7 +135802,7 @@ var Path = new Class({
*
* @param {Phaser.Types.Curves.JSONPath} data - The JSON object containing the Path data.
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
fromJSON: function (data)
{
@@ -132546,6 +136156,46 @@ var Path = new Class({
return out.copy(this.startPoint);
},
+ /**
+ * Gets a unit vector tangent at a relative position on the path.
+ *
+ * @method Phaser.Curves.Path#getTangent
+ * @since 3.23.0
+ *
+ * @generic {Phaser.Math.Vector2} O - [out,$return]
+ *
+ * @param {number} t - The relative position on the path, [0..1].
+ * @param {Phaser.Math.Vector2} [out] - A vector to store the result in.
+ *
+ * @return {Phaser.Math.Vector2} Vector approximating the tangent line at the point t (delta +/- 0.0001)
+ */
+ getTangent: function (t, out)
+ {
+ if (out === undefined) { out = new Vector2(); }
+
+ var d = t * this.getLength();
+ var curveLengths = this.getCurveLengths();
+ var i = 0;
+
+ while (i < curveLengths.length)
+ {
+ if (curveLengths[i] >= d)
+ {
+ var diff = curveLengths[i] - d;
+ var curve = this.curves[i];
+
+ var segmentLength = curve.getLength();
+ var u = (segmentLength === 0) ? 0 : 1 - diff / segmentLength;
+
+ return curve.getTangentAt(u, out);
+ }
+
+ i++;
+ }
+
+ return null;
+ },
+
/**
* Creates a line curve from the previous end point to x/y.
*
@@ -132555,7 +136205,7 @@ var Path = new Class({
* @param {(number|Phaser.Math.Vector2)} x - The X coordinate of the line's end point, or a `Vector2` containing the entire end point.
* @param {number} [y] - The Y coordinate of the line's end point, if a number was passed as the X parameter.
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
lineTo: function (x, y)
{
@@ -132581,7 +136231,7 @@ var Path = new Class({
*
* @param {Phaser.Math.Vector2[]} points - The points the newly created spline curve should consist of.
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
splineTo: function (points)
{
@@ -132599,9 +136249,9 @@ var Path = new Class({
* @since 3.0.0
*
* @param {(number|Phaser.Math.Vector2)} x - The X coordinate of the position to move the path's end point to, or a `Vector2` containing the entire new end point.
- * @param {number} y - The Y coordinate of the position to move the path's end point to, if a number was passed as the X coordinate.
+ * @param {number} [y] - The Y coordinate of the position to move the path's end point to, if a number was passed as the X coordinate.
*
- * @return {Phaser.Curves.Path} This Path object.
+ * @return {this} This Path object.
*/
moveTo: function (x, y)
{
@@ -132697,7 +136347,7 @@ module.exports = Path;
/***/ }),
-/* 789 */
+/* 800 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -132837,7 +136487,7 @@ module.exports = MoveTo;
/***/ }),
-/* 790 */
+/* 801 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -132852,15 +136502,15 @@ module.exports = MoveTo;
module.exports = {
- DataManager: __webpack_require__(113),
- DataManagerPlugin: __webpack_require__(791),
- Events: __webpack_require__(281)
+ DataManager: __webpack_require__(115),
+ DataManagerPlugin: __webpack_require__(802),
+ Events: __webpack_require__(288)
};
/***/ }),
-/* 791 */
+/* 802 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -132870,9 +136520,9 @@ module.exports = {
*/
var Class = __webpack_require__(0);
-var DataManager = __webpack_require__(113);
+var DataManager = __webpack_require__(115);
var PluginCache = __webpack_require__(23);
-var SceneEvents = __webpack_require__(19);
+var SceneEvents = __webpack_require__(22);
/**
* @classdesc
@@ -132987,7 +136637,7 @@ module.exports = DataManagerPlugin;
/***/ }),
-/* 792 */
+/* 803 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133002,18 +136652,18 @@ module.exports = DataManagerPlugin;
module.exports = {
- Align: __webpack_require__(793),
- BaseShader: __webpack_require__(347),
- Bounds: __webpack_require__(796),
- Canvas: __webpack_require__(799),
- Color: __webpack_require__(348),
- Masks: __webpack_require__(808)
+ Align: __webpack_require__(804),
+ BaseShader: __webpack_require__(353),
+ Bounds: __webpack_require__(807),
+ Canvas: __webpack_require__(811),
+ Color: __webpack_require__(354),
+ Masks: __webpack_require__(820)
};
/***/ }),
-/* 793 */
+/* 804 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133023,7 +136673,7 @@ module.exports = {
*/
var CONST = __webpack_require__(106);
-var Extend = __webpack_require__(17);
+var Extend = __webpack_require__(19);
/**
* @namespace Phaser.Display.Align
@@ -133031,8 +136681,8 @@ var Extend = __webpack_require__(17);
var Align = {
- In: __webpack_require__(794),
- To: __webpack_require__(795)
+ In: __webpack_require__(805),
+ To: __webpack_require__(806)
};
@@ -133043,7 +136693,7 @@ module.exports = Align;
/***/ }),
-/* 794 */
+/* 805 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133058,22 +136708,22 @@ module.exports = Align;
module.exports = {
- BottomCenter: __webpack_require__(253),
- BottomLeft: __webpack_require__(254),
- BottomRight: __webpack_require__(255),
- Center: __webpack_require__(256),
- LeftCenter: __webpack_require__(258),
- QuickSet: __webpack_require__(252),
- RightCenter: __webpack_require__(259),
- TopCenter: __webpack_require__(260),
- TopLeft: __webpack_require__(261),
- TopRight: __webpack_require__(262)
+ BottomCenter: __webpack_require__(260),
+ BottomLeft: __webpack_require__(261),
+ BottomRight: __webpack_require__(262),
+ Center: __webpack_require__(263),
+ LeftCenter: __webpack_require__(265),
+ QuickSet: __webpack_require__(259),
+ RightCenter: __webpack_require__(266),
+ TopCenter: __webpack_require__(267),
+ TopLeft: __webpack_require__(268),
+ TopRight: __webpack_require__(269)
};
/***/ }),
-/* 795 */
+/* 806 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133088,25 +136738,25 @@ module.exports = {
module.exports = {
- BottomCenter: __webpack_require__(240),
- BottomLeft: __webpack_require__(241),
- BottomRight: __webpack_require__(242),
- LeftBottom: __webpack_require__(243),
- LeftCenter: __webpack_require__(244),
- LeftTop: __webpack_require__(245),
- QuickSet: __webpack_require__(239),
- RightBottom: __webpack_require__(246),
- RightCenter: __webpack_require__(247),
- RightTop: __webpack_require__(248),
- TopCenter: __webpack_require__(249),
- TopLeft: __webpack_require__(250),
- TopRight: __webpack_require__(251)
+ BottomCenter: __webpack_require__(247),
+ BottomLeft: __webpack_require__(248),
+ BottomRight: __webpack_require__(249),
+ LeftBottom: __webpack_require__(250),
+ LeftCenter: __webpack_require__(251),
+ LeftTop: __webpack_require__(252),
+ QuickSet: __webpack_require__(246),
+ RightBottom: __webpack_require__(253),
+ RightCenter: __webpack_require__(254),
+ RightTop: __webpack_require__(255),
+ TopCenter: __webpack_require__(256),
+ TopLeft: __webpack_require__(257),
+ TopRight: __webpack_require__(258)
};
/***/ }),
-/* 796 */
+/* 807 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133121,27 +136771,72 @@ module.exports = {
module.exports = {
- CenterOn: __webpack_require__(257),
- GetBottom: __webpack_require__(38),
- GetCenterX: __webpack_require__(75),
- GetCenterY: __webpack_require__(77),
- GetLeft: __webpack_require__(40),
- GetOffsetX: __webpack_require__(797),
- GetOffsetY: __webpack_require__(798),
- GetRight: __webpack_require__(42),
- GetTop: __webpack_require__(45),
- SetBottom: __webpack_require__(44),
- SetCenterX: __webpack_require__(76),
- SetCenterY: __webpack_require__(78),
- SetLeft: __webpack_require__(41),
- SetRight: __webpack_require__(43),
- SetTop: __webpack_require__(39)
-
+ CenterOn: __webpack_require__(264),
+ GetBottom: __webpack_require__(34),
+ GetBounds: __webpack_require__(808),
+ GetCenterX: __webpack_require__(76),
+ GetCenterY: __webpack_require__(78),
+ GetLeft: __webpack_require__(35),
+ GetOffsetX: __webpack_require__(809),
+ GetOffsetY: __webpack_require__(810),
+ GetRight: __webpack_require__(36),
+ GetTop: __webpack_require__(37),
+ SetBottom: __webpack_require__(46),
+ SetCenterX: __webpack_require__(77),
+ SetCenterY: __webpack_require__(79),
+ SetLeft: __webpack_require__(44),
+ SetRight: __webpack_require__(45),
+ SetTop: __webpack_require__(43)
+
};
/***/ }),
-/* 797 */
+/* 808 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author samme
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+var GetBottom = __webpack_require__(34);
+var GetLeft = __webpack_require__(35);
+var GetRight = __webpack_require__(36);
+var GetTop = __webpack_require__(37);
+
+/**
+ * Returns the unrotated bounds of the Game Object as a rectangle.
+ *
+ * @function Phaser.Display.Bounds.GetBounds
+ * @since 3.24.0
+ *
+ * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.
+ * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in.
+ *
+ * @return {(Phaser.Geom.Rectangle|object)} - The bounds of the Game Object.
+ */
+var GetBounds = function (gameObject, output)
+{
+ if (output === undefined) { output = {}; }
+
+ var left = GetLeft(gameObject);
+ var top = GetTop(gameObject);
+
+ output.x = left;
+ output.y = top;
+ output.width = GetRight(gameObject) - left;
+ output.height = GetBottom(gameObject) - top;
+
+ return output;
+};
+
+module.exports = GetBounds;
+
+
+/***/ }),
+/* 809 */
/***/ (function(module, exports) {
/**
@@ -133171,7 +136866,7 @@ module.exports = GetOffsetX;
/***/ }),
-/* 798 */
+/* 810 */
/***/ (function(module, exports) {
/**
@@ -133201,7 +136896,7 @@ module.exports = GetOffsetY;
/***/ }),
-/* 799 */
+/* 811 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133216,17 +136911,17 @@ module.exports = GetOffsetY;
module.exports = {
- CanvasInterpolation: __webpack_require__(335),
+ CanvasInterpolation: __webpack_require__(341),
CanvasPool: __webpack_require__(26),
- Smoothing: __webpack_require__(164),
- TouchAction: __webpack_require__(800),
- UserSelect: __webpack_require__(801)
+ Smoothing: __webpack_require__(172),
+ TouchAction: __webpack_require__(812),
+ UserSelect: __webpack_require__(813)
};
/***/ }),
-/* 800 */
+/* 812 */
/***/ (function(module, exports) {
/**
@@ -133261,7 +136956,7 @@ module.exports = TouchAction;
/***/ }),
-/* 801 */
+/* 813 */
/***/ (function(module, exports) {
/**
@@ -133308,7 +137003,7 @@ module.exports = UserSelect;
/***/ }),
-/* 802 */
+/* 814 */
/***/ (function(module, exports) {
/**
@@ -133348,7 +137043,7 @@ module.exports = ColorToRGBA;
/***/ }),
-/* 803 */
+/* 815 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133357,8 +137052,8 @@ module.exports = ColorToRGBA;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Color = __webpack_require__(33);
-var HueToComponent = __webpack_require__(350);
+var Color = __webpack_require__(31);
+var HueToComponent = __webpack_require__(356);
/**
* Converts HSL (hue, saturation and lightness) values to a Phaser Color object.
@@ -133398,7 +137093,7 @@ module.exports = HSLToColor;
/***/ }),
-/* 804 */
+/* 816 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133407,7 +137102,7 @@ module.exports = HSLToColor;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var HSVToRGB = __webpack_require__(163);
+var HSVToRGB = __webpack_require__(171);
/**
* Get HSV color wheel values in an array which will be 360 elements in size.
@@ -133439,7 +137134,7 @@ module.exports = HSVColorWheel;
/***/ }),
-/* 805 */
+/* 817 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133448,7 +137143,7 @@ module.exports = HSVColorWheel;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Linear = __webpack_require__(115);
+var Linear = __webpack_require__(118);
/**
* @namespace Phaser.Display.Color.Interpolate
@@ -133547,7 +137242,7 @@ module.exports = {
/***/ }),
-/* 806 */
+/* 818 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133556,8 +137251,8 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Between = __webpack_require__(170);
-var Color = __webpack_require__(33);
+var Between = __webpack_require__(177);
+var Color = __webpack_require__(31);
/**
* Creates a new Color object where the r, g, and b values have been set to random values
@@ -133583,7 +137278,7 @@ module.exports = RandomRGB;
/***/ }),
-/* 807 */
+/* 819 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133592,7 +137287,7 @@ module.exports = RandomRGB;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ComponentToHex = __webpack_require__(349);
+var ComponentToHex = __webpack_require__(355);
/**
* Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`.
@@ -133627,7 +137322,7 @@ module.exports = RGBToString;
/***/ }),
-/* 808 */
+/* 820 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133642,14 +137337,14 @@ module.exports = RGBToString;
module.exports = {
- BitmapMask: __webpack_require__(275),
- GeometryMask: __webpack_require__(276)
+ BitmapMask: __webpack_require__(282),
+ GeometryMask: __webpack_require__(283)
};
/***/ }),
-/* 809 */
+/* 821 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133664,13 +137359,13 @@ module.exports = {
var Dom = {
- AddToDOM: __webpack_require__(120),
- DOMContentLoaded: __webpack_require__(351),
- GetScreenOrientation: __webpack_require__(352),
- GetTarget: __webpack_require__(357),
- ParseXML: __webpack_require__(358),
- RemoveFromDOM: __webpack_require__(176),
- RequestAnimationFrame: __webpack_require__(338)
+ AddToDOM: __webpack_require__(124),
+ DOMContentLoaded: __webpack_require__(357),
+ GetScreenOrientation: __webpack_require__(358),
+ GetTarget: __webpack_require__(363),
+ ParseXML: __webpack_require__(364),
+ RemoveFromDOM: __webpack_require__(184),
+ RequestAnimationFrame: __webpack_require__(344)
};
@@ -133678,7 +137373,7 @@ module.exports = Dom;
/***/ }),
-/* 810 */
+/* 822 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133691,11 +137386,11 @@ module.exports = Dom;
* @namespace Phaser.Events
*/
-module.exports = { EventEmitter: __webpack_require__(811) };
+module.exports = { EventEmitter: __webpack_require__(823) };
/***/ }),
-/* 811 */
+/* 823 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133705,7 +137400,7 @@ module.exports = { EventEmitter: __webpack_require__(811) };
*/
var Class = __webpack_require__(0);
-var EE = __webpack_require__(9);
+var EE = __webpack_require__(11);
var PluginCache = __webpack_require__(23);
/**
@@ -133879,7 +137574,7 @@ module.exports = EventEmitter;
/***/ }),
-/* 812 */
+/* 824 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -133888,33 +137583,33 @@ module.exports = EventEmitter;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var AddToDOM = __webpack_require__(120);
-var AnimationManager = __webpack_require__(286);
-var CacheManager = __webpack_require__(289);
+var AddToDOM = __webpack_require__(124);
+var AnimationManager = __webpack_require__(293);
+var CacheManager = __webpack_require__(296);
var CanvasPool = __webpack_require__(26);
var Class = __webpack_require__(0);
-var Config = __webpack_require__(311);
-var CreateDOMContainer = __webpack_require__(813);
-var CreateRenderer = __webpack_require__(334);
-var DataManager = __webpack_require__(113);
-var DebugHeader = __webpack_require__(336);
-var Device = __webpack_require__(312);
-var DOMContentLoaded = __webpack_require__(351);
-var EventEmitter = __webpack_require__(9);
-var Events = __webpack_require__(18);
-var InputManager = __webpack_require__(359);
+var Config = __webpack_require__(318);
+var CreateDOMContainer = __webpack_require__(825);
+var CreateRenderer = __webpack_require__(340);
+var DataManager = __webpack_require__(115);
+var DebugHeader = __webpack_require__(342);
+var Device = __webpack_require__(319);
+var DOMContentLoaded = __webpack_require__(357);
+var EventEmitter = __webpack_require__(11);
+var Events = __webpack_require__(20);
+var InputManager = __webpack_require__(365);
var PluginCache = __webpack_require__(23);
-var PluginManager = __webpack_require__(364);
-var ScaleManager = __webpack_require__(365);
-var SceneManager = __webpack_require__(367);
-var TextureEvents = __webpack_require__(119);
-var TextureManager = __webpack_require__(370);
-var TimeStep = __webpack_require__(337);
-var VisibilityHandler = __webpack_require__(339);
+var PluginManager = __webpack_require__(370);
+var ScaleManager = __webpack_require__(371);
+var SceneManager = __webpack_require__(373);
+var TextureEvents = __webpack_require__(123);
+var TextureManager = __webpack_require__(376);
+var TimeStep = __webpack_require__(343);
+var VisibilityHandler = __webpack_require__(345);
if (true)
{
- var SoundManagerCreator = __webpack_require__(374);
+ var SoundManagerCreator = __webpack_require__(380);
}
if (false)
@@ -134259,7 +137954,7 @@ var Game = new Class({
*
* @method Phaser.Game#texturesReady
* @private
- * @fires Phaser.Game#ready
+ * @fires Phaser.Game#READY
* @since 3.12.0
*/
texturesReady: function ()
@@ -134313,11 +138008,11 @@ var Game = new Class({
* It will then render each Scene in turn, via the Renderer. This process emits `prerender` and `postrender` events.
*
* @method Phaser.Game#step
- * @fires Phaser.Core.Events#PRE_STEP_EVENT
- * @fires Phaser.Core.Events#STEP_EVENT
- * @fires Phaser.Core.Events#POST_STEP_EVENT
- * @fires Phaser.Core.Events#PRE_RENDER_EVENT
- * @fires Phaser.Core.Events#POST_RENDER_EVENT
+ * @fires Phaser.Core.Events#PRE_STEP
+ * @fires Phaser.Core.Events#STEP
+ * @fires Phaser.Core.Events#POST_STEP
+ * @fires Phaser.Core.Events#PRE_RENDER
+ * @fires Phaser.Core.Events#POST_RENDER
* @since 3.0.0
*
* @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.
@@ -134380,8 +138075,8 @@ var Game = new Class({
* This process emits `prerender` and `postrender` events, even though nothing actually displays.
*
* @method Phaser.Game#headlessStep
- * @fires Phaser.Game#prerenderEvent
- * @fires Phaser.Game#postrenderEvent
+ * @fires Phaser.Game#PRE_RENDER
+ * @fires Phaser.Game#POST_RENDER
* @since 3.2.0
*
* @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.
@@ -134542,7 +138237,7 @@ var Game = new Class({
runDestroy: function ()
{
this.scene.destroy();
-
+
this.events.emit(Events.DESTROY);
this.events.removeAllListeners();
@@ -134582,7 +138277,7 @@ module.exports = Game;
/***/ }),
-/* 813 */
+/* 825 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -134591,7 +138286,7 @@ module.exports = Game;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var AddToDOM = __webpack_require__(120);
+var AddToDOM = __webpack_require__(124);
var CreateDOMContainer = function (game)
{
@@ -134626,7 +138321,7 @@ module.exports = CreateDOMContainer;
/***/ }),
-/* 814 */
+/* 826 */
/***/ (function(module, exports) {
/**
@@ -134647,7 +138342,7 @@ module.exports = 'boot';
/***/ }),
-/* 815 */
+/* 827 */
/***/ (function(module, exports) {
/**
@@ -134668,7 +138363,7 @@ module.exports = 'destroy';
/***/ }),
-/* 816 */
+/* 828 */
/***/ (function(module, exports) {
/**
@@ -134696,7 +138391,7 @@ module.exports = 'dragend';
/***/ }),
-/* 817 */
+/* 829 */
/***/ (function(module, exports) {
/**
@@ -134727,7 +138422,7 @@ module.exports = 'dragenter';
/***/ }),
-/* 818 */
+/* 830 */
/***/ (function(module, exports) {
/**
@@ -134759,7 +138454,7 @@ module.exports = 'drag';
/***/ }),
-/* 819 */
+/* 831 */
/***/ (function(module, exports) {
/**
@@ -134790,7 +138485,7 @@ module.exports = 'dragleave';
/***/ }),
-/* 820 */
+/* 832 */
/***/ (function(module, exports) {
/**
@@ -134824,7 +138519,7 @@ module.exports = 'dragover';
/***/ }),
-/* 821 */
+/* 833 */
/***/ (function(module, exports) {
/**
@@ -134854,7 +138549,7 @@ module.exports = 'dragstart';
/***/ }),
-/* 822 */
+/* 834 */
/***/ (function(module, exports) {
/**
@@ -134883,7 +138578,7 @@ module.exports = 'drop';
/***/ }),
-/* 823 */
+/* 835 */
/***/ (function(module, exports) {
/**
@@ -134910,7 +138605,7 @@ module.exports = 'gameout';
/***/ }),
-/* 824 */
+/* 836 */
/***/ (function(module, exports) {
/**
@@ -134937,7 +138632,7 @@ module.exports = 'gameover';
/***/ }),
-/* 825 */
+/* 837 */
/***/ (function(module, exports) {
/**
@@ -134978,7 +138673,7 @@ module.exports = 'gameobjectdown';
/***/ }),
-/* 826 */
+/* 838 */
/***/ (function(module, exports) {
/**
@@ -135009,7 +138704,7 @@ module.exports = 'dragend';
/***/ }),
-/* 827 */
+/* 839 */
/***/ (function(module, exports) {
/**
@@ -135039,7 +138734,7 @@ module.exports = 'dragenter';
/***/ }),
-/* 828 */
+/* 840 */
/***/ (function(module, exports) {
/**
@@ -135070,7 +138765,7 @@ module.exports = 'drag';
/***/ }),
-/* 829 */
+/* 841 */
/***/ (function(module, exports) {
/**
@@ -135100,7 +138795,7 @@ module.exports = 'dragleave';
/***/ }),
-/* 830 */
+/* 842 */
/***/ (function(module, exports) {
/**
@@ -135133,7 +138828,7 @@ module.exports = 'dragover';
/***/ }),
-/* 831 */
+/* 843 */
/***/ (function(module, exports) {
/**
@@ -135167,7 +138862,7 @@ module.exports = 'dragstart';
/***/ }),
-/* 832 */
+/* 844 */
/***/ (function(module, exports) {
/**
@@ -135197,7 +138892,7 @@ module.exports = 'drop';
/***/ }),
-/* 833 */
+/* 845 */
/***/ (function(module, exports) {
/**
@@ -135238,7 +138933,7 @@ module.exports = 'gameobjectmove';
/***/ }),
-/* 834 */
+/* 846 */
/***/ (function(module, exports) {
/**
@@ -135279,7 +138974,7 @@ module.exports = 'gameobjectout';
/***/ }),
-/* 835 */
+/* 847 */
/***/ (function(module, exports) {
/**
@@ -135320,7 +139015,7 @@ module.exports = 'gameobjectover';
/***/ }),
-/* 836 */
+/* 848 */
/***/ (function(module, exports) {
/**
@@ -135361,7 +139056,7 @@ module.exports = 'pointerdown';
/***/ }),
-/* 837 */
+/* 849 */
/***/ (function(module, exports) {
/**
@@ -135402,7 +139097,7 @@ module.exports = 'pointermove';
/***/ }),
-/* 838 */
+/* 850 */
/***/ (function(module, exports) {
/**
@@ -135441,7 +139136,7 @@ module.exports = 'pointerout';
/***/ }),
-/* 839 */
+/* 851 */
/***/ (function(module, exports) {
/**
@@ -135482,7 +139177,7 @@ module.exports = 'pointerover';
/***/ }),
-/* 840 */
+/* 852 */
/***/ (function(module, exports) {
/**
@@ -135523,7 +139218,7 @@ module.exports = 'pointerup';
/***/ }),
-/* 841 */
+/* 853 */
/***/ (function(module, exports) {
/**
@@ -135565,7 +139260,7 @@ module.exports = 'wheel';
/***/ }),
-/* 842 */
+/* 854 */
/***/ (function(module, exports) {
/**
@@ -135606,7 +139301,7 @@ module.exports = 'gameobjectup';
/***/ }),
-/* 843 */
+/* 855 */
/***/ (function(module, exports) {
/**
@@ -135650,7 +139345,7 @@ module.exports = 'gameobjectwheel';
/***/ }),
-/* 844 */
+/* 856 */
/***/ (function(module, exports) {
/**
@@ -135671,7 +139366,7 @@ module.exports = 'boot';
/***/ }),
-/* 845 */
+/* 857 */
/***/ (function(module, exports) {
/**
@@ -135696,7 +139391,7 @@ module.exports = 'process';
/***/ }),
-/* 846 */
+/* 858 */
/***/ (function(module, exports) {
/**
@@ -135717,7 +139412,7 @@ module.exports = 'update';
/***/ }),
-/* 847 */
+/* 859 */
/***/ (function(module, exports) {
/**
@@ -135752,7 +139447,7 @@ module.exports = 'pointerdown';
/***/ }),
-/* 848 */
+/* 860 */
/***/ (function(module, exports) {
/**
@@ -135786,7 +139481,7 @@ module.exports = 'pointerdownoutside';
/***/ }),
-/* 849 */
+/* 861 */
/***/ (function(module, exports) {
/**
@@ -135821,7 +139516,7 @@ module.exports = 'pointermove';
/***/ }),
-/* 850 */
+/* 862 */
/***/ (function(module, exports) {
/**
@@ -135856,7 +139551,7 @@ module.exports = 'pointerout';
/***/ }),
-/* 851 */
+/* 863 */
/***/ (function(module, exports) {
/**
@@ -135891,7 +139586,7 @@ module.exports = 'pointerover';
/***/ }),
-/* 852 */
+/* 864 */
/***/ (function(module, exports) {
/**
@@ -135926,7 +139621,7 @@ module.exports = 'pointerup';
/***/ }),
-/* 853 */
+/* 865 */
/***/ (function(module, exports) {
/**
@@ -135960,7 +139655,7 @@ module.exports = 'pointerupoutside';
/***/ }),
-/* 854 */
+/* 866 */
/***/ (function(module, exports) {
/**
@@ -135998,7 +139693,7 @@ module.exports = 'wheel';
/***/ }),
-/* 855 */
+/* 867 */
/***/ (function(module, exports) {
/**
@@ -136022,7 +139717,7 @@ module.exports = 'pointerlockchange';
/***/ }),
-/* 856 */
+/* 868 */
/***/ (function(module, exports) {
/**
@@ -136044,7 +139739,7 @@ module.exports = 'preupdate';
/***/ }),
-/* 857 */
+/* 869 */
/***/ (function(module, exports) {
/**
@@ -136065,7 +139760,7 @@ module.exports = 'shutdown';
/***/ }),
-/* 858 */
+/* 870 */
/***/ (function(module, exports) {
/**
@@ -136087,7 +139782,7 @@ module.exports = 'start';
/***/ }),
-/* 859 */
+/* 871 */
/***/ (function(module, exports) {
/**
@@ -136112,7 +139807,7 @@ module.exports = 'update';
/***/ }),
-/* 860 */
+/* 872 */
/***/ (function(module, exports) {
/**
@@ -136171,7 +139866,7 @@ module.exports = GetInnerHeight;
/***/ }),
-/* 861 */
+/* 873 */
/***/ (function(module, exports) {
/**
@@ -136201,7 +139896,7 @@ module.exports = 'addfile';
/***/ }),
-/* 862 */
+/* 874 */
/***/ (function(module, exports) {
/**
@@ -136229,7 +139924,7 @@ module.exports = 'complete';
/***/ }),
-/* 863 */
+/* 875 */
/***/ (function(module, exports) {
/**
@@ -136258,7 +139953,7 @@ module.exports = 'filecomplete';
/***/ }),
-/* 864 */
+/* 876 */
/***/ (function(module, exports) {
/**
@@ -136312,7 +140007,7 @@ module.exports = 'filecomplete-';
/***/ }),
-/* 865 */
+/* 877 */
/***/ (function(module, exports) {
/**
@@ -136337,7 +140032,7 @@ module.exports = 'loaderror';
/***/ }),
-/* 866 */
+/* 878 */
/***/ (function(module, exports) {
/**
@@ -136363,7 +140058,7 @@ module.exports = 'load';
/***/ }),
-/* 867 */
+/* 879 */
/***/ (function(module, exports) {
/**
@@ -136390,7 +140085,7 @@ module.exports = 'fileprogress';
/***/ }),
-/* 868 */
+/* 880 */
/***/ (function(module, exports) {
/**
@@ -136419,7 +140114,7 @@ module.exports = 'postprocess';
/***/ }),
-/* 869 */
+/* 881 */
/***/ (function(module, exports) {
/**
@@ -136444,7 +140139,7 @@ module.exports = 'progress';
/***/ }),
-/* 870 */
+/* 882 */
/***/ (function(module, exports) {
/**
@@ -136471,7 +140166,7 @@ module.exports = 'start';
/***/ }),
-/* 871 */
+/* 883 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -136481,7 +140176,7 @@ module.exports = 'start';
*/
var GetFastValue = __webpack_require__(2);
-var UppercaseFirst = __webpack_require__(179);
+var UppercaseFirst = __webpack_require__(187);
/**
* Builds an array of which physics plugins should be activated for the given Scene.
@@ -136533,7 +140228,7 @@ module.exports = GetPhysicsPlugins;
/***/ }),
-/* 872 */
+/* 884 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -136580,7 +140275,7 @@ module.exports = GetScenePlugins;
/***/ }),
-/* 873 */
+/* 885 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -136641,7 +140336,7 @@ module.exports = InjectionMap;
/***/ }),
-/* 874 */
+/* 886 */
/***/ (function(module, exports) {
/**
@@ -136722,7 +140417,7 @@ module.exports = AtlasXML;
/***/ }),
-/* 875 */
+/* 887 */
/***/ (function(module, exports) {
/**
@@ -136757,7 +140452,7 @@ module.exports = Canvas;
/***/ }),
-/* 876 */
+/* 888 */
/***/ (function(module, exports) {
/**
@@ -136792,7 +140487,7 @@ module.exports = Image;
/***/ }),
-/* 877 */
+/* 889 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -136863,11 +140558,13 @@ var JSONArray = function (texture, sourceIndex, json)
newFrame.updateUVsInverted();
}
- if (src.anchor)
+ var pivot = src.anchor || src.pivot;
+
+ if (pivot)
{
newFrame.customPivot = true;
- newFrame.pivotX = src.anchor.x;
- newFrame.pivotY = src.anchor.y;
+ newFrame.pivotX = pivot.x;
+ newFrame.pivotY = pivot.y;
}
// Copy over any extra data
@@ -136899,7 +140596,7 @@ module.exports = JSONArray;
/***/ }),
-/* 878 */
+/* 890 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -136940,7 +140637,7 @@ var JSONHash = function (texture, sourceIndex, json)
texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);
// By this stage frames is a fully parsed Object
- var frames = json['frames'];
+ var frames = json.frames;
var newFrame;
for (var key in frames)
@@ -136969,6 +140666,15 @@ var JSONHash = function (texture, sourceIndex, json)
newFrame.updateUVsInverted();
}
+ var pivot = src.anchor || src.pivot;
+
+ if (pivot)
+ {
+ newFrame.customPivot = true;
+ newFrame.pivotX = pivot.x;
+ newFrame.pivotY = pivot.y;
+ }
+
// Copy over any extra data
newFrame.customData = Clone(src);
}
@@ -136998,7 +140704,7 @@ module.exports = JSONHash;
/***/ }),
-/* 879 */
+/* 891 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -137011,7 +140717,7 @@ var GetFastValue = __webpack_require__(2);
/**
* Parses a Sprite Sheet and adds the Frames to the Texture.
- *
+ *
* In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact
* same size and cannot be trimmed or rotated.
*
@@ -137022,15 +140728,15 @@ var GetFastValue = __webpack_require__(2);
*
* @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.
* @param {integer} sourceIndex - The index of the TextureSource.
- * @param {integer} x - [description]
- * @param {integer} y - [description]
- * @param {integer} width - [description]
- * @param {integer} height - [description]
+ * @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 {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.
- * @param {number} [config.startFrame=0] - [description]
- * @param {number} [config.endFrame=-1] - [description]
+ * @param {number} [config.startFrame=0] - The frame to start extracting from. Defaults to zero.
+ * @param {number} [config.endFrame=-1] - The frame to finish extracting at. Defaults to -1, which means 'all frames'.
* @param {number} [config.margin=0] - If the frames have been drawn with a margin, specify the amount here.
* @param {number} [config.spacing=0] - If the frames have been drawn with spacing between them, specify the amount here.
*
@@ -137063,7 +140769,7 @@ var SpriteSheet = function (texture, sourceIndex, x, y, width, height, config)
if (total === 0)
{
- console.warn('SpriteSheet frame dimensions will result in zero frames.');
+ console.warn('SpriteSheet frame dimensions will result in zero frames for texture:', texture.key);
}
if (startFrame > total || startFrame < -total)
@@ -137123,7 +140829,7 @@ module.exports = SpriteSheet;
/***/ }),
-/* 880 */
+/* 892 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -137314,7 +141020,7 @@ module.exports = SpriteSheetFromAtlas;
/***/ }),
-/* 881 */
+/* 893 */
/***/ (function(module, exports) {
/**
@@ -137484,7 +141190,7 @@ TextureImporter:
/***/ }),
-/* 882 */
+/* 894 */
/***/ (function(module, exports) {
/**
@@ -137515,7 +141221,7 @@ module.exports = 'complete';
/***/ }),
-/* 883 */
+/* 895 */
/***/ (function(module, exports) {
/**
@@ -137545,7 +141251,7 @@ module.exports = 'decoded';
/***/ }),
-/* 884 */
+/* 896 */
/***/ (function(module, exports) {
/**
@@ -137577,7 +141283,7 @@ module.exports = 'decodedall';
/***/ }),
-/* 885 */
+/* 897 */
/***/ (function(module, exports) {
/**
@@ -137609,7 +141315,7 @@ module.exports = 'destroy';
/***/ }),
-/* 886 */
+/* 898 */
/***/ (function(module, exports) {
/**
@@ -137642,7 +141348,7 @@ module.exports = 'detune';
/***/ }),
-/* 887 */
+/* 899 */
/***/ (function(module, exports) {
/**
@@ -137670,7 +141376,7 @@ module.exports = 'detune';
/***/ }),
-/* 888 */
+/* 900 */
/***/ (function(module, exports) {
/**
@@ -137697,7 +141403,7 @@ module.exports = 'mute';
/***/ }),
-/* 889 */
+/* 901 */
/***/ (function(module, exports) {
/**
@@ -137725,7 +141431,7 @@ module.exports = 'rate';
/***/ }),
-/* 890 */
+/* 902 */
/***/ (function(module, exports) {
/**
@@ -137752,7 +141458,7 @@ module.exports = 'volume';
/***/ }),
-/* 891 */
+/* 903 */
/***/ (function(module, exports) {
/**
@@ -137786,7 +141492,7 @@ module.exports = 'loop';
/***/ }),
-/* 892 */
+/* 904 */
/***/ (function(module, exports) {
/**
@@ -137820,7 +141526,7 @@ module.exports = 'looped';
/***/ }),
-/* 893 */
+/* 905 */
/***/ (function(module, exports) {
/**
@@ -137853,7 +141559,7 @@ module.exports = 'mute';
/***/ }),
-/* 894 */
+/* 906 */
/***/ (function(module, exports) {
/**
@@ -137880,7 +141586,7 @@ module.exports = 'pauseall';
/***/ }),
-/* 895 */
+/* 907 */
/***/ (function(module, exports) {
/**
@@ -137912,7 +141618,7 @@ module.exports = 'pause';
/***/ }),
-/* 896 */
+/* 908 */
/***/ (function(module, exports) {
/**
@@ -137943,7 +141649,7 @@ module.exports = 'play';
/***/ }),
-/* 897 */
+/* 909 */
/***/ (function(module, exports) {
/**
@@ -137976,7 +141682,7 @@ module.exports = 'rate';
/***/ }),
-/* 898 */
+/* 910 */
/***/ (function(module, exports) {
/**
@@ -138003,7 +141709,7 @@ module.exports = 'resumeall';
/***/ }),
-/* 899 */
+/* 911 */
/***/ (function(module, exports) {
/**
@@ -138036,7 +141742,7 @@ module.exports = 'resume';
/***/ }),
-/* 900 */
+/* 912 */
/***/ (function(module, exports) {
/**
@@ -138069,7 +141775,7 @@ module.exports = 'seek';
/***/ }),
-/* 901 */
+/* 913 */
/***/ (function(module, exports) {
/**
@@ -138096,7 +141802,7 @@ module.exports = 'stopall';
/***/ }),
-/* 902 */
+/* 914 */
/***/ (function(module, exports) {
/**
@@ -138128,7 +141834,7 @@ module.exports = 'stop';
/***/ }),
-/* 903 */
+/* 915 */
/***/ (function(module, exports) {
/**
@@ -138155,7 +141861,7 @@ module.exports = 'unlocked';
/***/ }),
-/* 904 */
+/* 916 */
/***/ (function(module, exports) {
/**
@@ -138188,7 +141894,7 @@ module.exports = 'volume';
/***/ }),
-/* 905 */
+/* 917 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -138205,100 +141911,103 @@ var GameObjects = {
Events: __webpack_require__(90),
- DisplayList: __webpack_require__(906),
+ DisplayList: __webpack_require__(918),
GameObjectCreator: __webpack_require__(16),
GameObjectFactory: __webpack_require__(5),
- UpdateList: __webpack_require__(934),
+ UpdateList: __webpack_require__(944),
Components: __webpack_require__(12),
- BuildGameObject: __webpack_require__(28),
- BuildGameObjectAnimation: __webpack_require__(385),
+ BuildGameObject: __webpack_require__(27),
+ BuildGameObjectAnimation: __webpack_require__(393),
GameObject: __webpack_require__(14),
- BitmapText: __webpack_require__(129),
- Blitter: __webpack_require__(186),
- Container: __webpack_require__(187),
- DOMElement: __webpack_require__(387),
- DynamicBitmapText: __webpack_require__(188),
- Extern: __webpack_require__(389),
- Graphics: __webpack_require__(189),
- Group: __webpack_require__(97),
- Image: __webpack_require__(98),
- Particles: __webpack_require__(966),
- PathFollower: __webpack_require__(401),
- RenderTexture: __webpack_require__(193),
- RetroFont: __webpack_require__(975),
- Sprite: __webpack_require__(69),
- Text: __webpack_require__(195),
- TileSprite: __webpack_require__(196),
- Zone: __webpack_require__(110),
- Video: __webpack_require__(197),
+ BitmapText: __webpack_require__(134),
+ Blitter: __webpack_require__(194),
+ Container: __webpack_require__(195),
+ DOMElement: __webpack_require__(395),
+ DynamicBitmapText: __webpack_require__(196),
+ Extern: __webpack_require__(397),
+ Graphics: __webpack_require__(197),
+ Group: __webpack_require__(98),
+ Image: __webpack_require__(108),
+ Particles: __webpack_require__(977),
+ PathFollower: __webpack_require__(409),
+ RenderTexture: __webpack_require__(201),
+ RetroFont: __webpack_require__(986),
+ Rope: __webpack_require__(203),
+ Sprite: __webpack_require__(75),
+ Text: __webpack_require__(204),
+ TileSprite: __webpack_require__(205),
+ Zone: __webpack_require__(111),
+ Video: __webpack_require__(206),
// Shapes
- Shape: __webpack_require__(30),
- Arc: __webpack_require__(402),
- Curve: __webpack_require__(403),
- Ellipse: __webpack_require__(404),
- Grid: __webpack_require__(405),
- IsoBox: __webpack_require__(406),
- IsoTriangle: __webpack_require__(407),
- Line: __webpack_require__(408),
- Polygon: __webpack_require__(409),
- Rectangle: __webpack_require__(414),
- Star: __webpack_require__(415),
- Triangle: __webpack_require__(416),
+ Shape: __webpack_require__(29),
+ Arc: __webpack_require__(410),
+ Curve: __webpack_require__(411),
+ Ellipse: __webpack_require__(412),
+ Grid: __webpack_require__(413),
+ IsoBox: __webpack_require__(414),
+ IsoTriangle: __webpack_require__(415),
+ Line: __webpack_require__(416),
+ Polygon: __webpack_require__(417),
+ Rectangle: __webpack_require__(422),
+ Star: __webpack_require__(423),
+ Triangle: __webpack_require__(424),
// Game Object Factories
Factories: {
- Blitter: __webpack_require__(1023),
- Container: __webpack_require__(1024),
- DOMElement: __webpack_require__(1025),
- DynamicBitmapText: __webpack_require__(1026),
- Extern: __webpack_require__(1027),
- Graphics: __webpack_require__(1028),
- Group: __webpack_require__(1029),
- Image: __webpack_require__(1030),
- Particles: __webpack_require__(1031),
- PathFollower: __webpack_require__(1032),
- RenderTexture: __webpack_require__(1033),
- Sprite: __webpack_require__(1034),
- StaticBitmapText: __webpack_require__(1035),
- Text: __webpack_require__(1036),
- TileSprite: __webpack_require__(1037),
- Zone: __webpack_require__(1038),
- Video: __webpack_require__(1039),
+ Blitter: __webpack_require__(1037),
+ Container: __webpack_require__(1038),
+ DOMElement: __webpack_require__(1039),
+ DynamicBitmapText: __webpack_require__(1040),
+ Extern: __webpack_require__(1041),
+ Graphics: __webpack_require__(1042),
+ Group: __webpack_require__(1043),
+ Image: __webpack_require__(1044),
+ Particles: __webpack_require__(1045),
+ PathFollower: __webpack_require__(1046),
+ RenderTexture: __webpack_require__(1047),
+ Rope: __webpack_require__(1048),
+ Sprite: __webpack_require__(1049),
+ StaticBitmapText: __webpack_require__(1050),
+ Text: __webpack_require__(1051),
+ TileSprite: __webpack_require__(1052),
+ Zone: __webpack_require__(1053),
+ Video: __webpack_require__(1054),
// Shapes
- Arc: __webpack_require__(1040),
- Curve: __webpack_require__(1041),
- Ellipse: __webpack_require__(1042),
- Grid: __webpack_require__(1043),
- IsoBox: __webpack_require__(1044),
- IsoTriangle: __webpack_require__(1045),
- Line: __webpack_require__(1046),
- Polygon: __webpack_require__(1047),
- Rectangle: __webpack_require__(1048),
- Star: __webpack_require__(1049),
- Triangle: __webpack_require__(1050)
+ Arc: __webpack_require__(1055),
+ Curve: __webpack_require__(1056),
+ Ellipse: __webpack_require__(1057),
+ Grid: __webpack_require__(1058),
+ IsoBox: __webpack_require__(1059),
+ IsoTriangle: __webpack_require__(1060),
+ Line: __webpack_require__(1061),
+ Polygon: __webpack_require__(1062),
+ Rectangle: __webpack_require__(1063),
+ Star: __webpack_require__(1064),
+ Triangle: __webpack_require__(1065)
},
Creators: {
- Blitter: __webpack_require__(1051),
- Container: __webpack_require__(1052),
- DynamicBitmapText: __webpack_require__(1053),
- Graphics: __webpack_require__(1054),
- Group: __webpack_require__(1055),
- Image: __webpack_require__(1056),
- Particles: __webpack_require__(1057),
- RenderTexture: __webpack_require__(1058),
- Sprite: __webpack_require__(1059),
- StaticBitmapText: __webpack_require__(1060),
- Text: __webpack_require__(1061),
- TileSprite: __webpack_require__(1062),
- Zone: __webpack_require__(1063),
- Video: __webpack_require__(1064)
+ Blitter: __webpack_require__(1066),
+ Container: __webpack_require__(1067),
+ DynamicBitmapText: __webpack_require__(1068),
+ Graphics: __webpack_require__(1069),
+ Group: __webpack_require__(1070),
+ Image: __webpack_require__(1071),
+ Particles: __webpack_require__(1072),
+ RenderTexture: __webpack_require__(1073),
+ Rope: __webpack_require__(1074),
+ Sprite: __webpack_require__(1075),
+ StaticBitmapText: __webpack_require__(1076),
+ Text: __webpack_require__(1077),
+ TileSprite: __webpack_require__(1078),
+ Zone: __webpack_require__(1079),
+ Video: __webpack_require__(1080)
}
};
@@ -138306,29 +142015,29 @@ var GameObjects = {
if (true)
{
// WebGL only Game Objects
- GameObjects.Mesh = __webpack_require__(130);
- GameObjects.Quad = __webpack_require__(200);
- GameObjects.Shader = __webpack_require__(201);
+ GameObjects.Mesh = __webpack_require__(136);
+ GameObjects.Quad = __webpack_require__(209);
+ GameObjects.Shader = __webpack_require__(210);
- GameObjects.Factories.Mesh = __webpack_require__(1071);
- GameObjects.Factories.Quad = __webpack_require__(1072);
- GameObjects.Factories.Shader = __webpack_require__(1073);
+ GameObjects.Factories.Mesh = __webpack_require__(1087);
+ GameObjects.Factories.Quad = __webpack_require__(1088);
+ GameObjects.Factories.Shader = __webpack_require__(1089);
- GameObjects.Creators.Mesh = __webpack_require__(1074);
- GameObjects.Creators.Quad = __webpack_require__(1075);
- GameObjects.Creators.Shader = __webpack_require__(1076);
+ GameObjects.Creators.Mesh = __webpack_require__(1090);
+ GameObjects.Creators.Quad = __webpack_require__(1091);
+ GameObjects.Creators.Shader = __webpack_require__(1092);
- GameObjects.Light = __webpack_require__(420);
+ GameObjects.Light = __webpack_require__(428);
- __webpack_require__(421);
- __webpack_require__(1077);
+ __webpack_require__(429);
+ __webpack_require__(1093);
}
module.exports = GameObjects;
/***/ }),
-/* 906 */
+/* 918 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -138338,10 +142047,10 @@ module.exports = GameObjects;
*/
var Class = __webpack_require__(0);
-var List = __webpack_require__(126);
+var List = __webpack_require__(131);
var PluginCache = __webpack_require__(23);
-var SceneEvents = __webpack_require__(19);
-var StableSort = __webpack_require__(128);
+var SceneEvents = __webpack_require__(22);
+var StableSort = __webpack_require__(133);
/**
* @classdesc
@@ -138533,7 +142242,7 @@ module.exports = DisplayList;
/***/ }),
-/* 907 */
+/* 919 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -138548,21 +142257,21 @@ module.exports = DisplayList;
module.exports = {
- CheckMatrix: __webpack_require__(182),
- MatrixToString: __webpack_require__(908),
- ReverseColumns: __webpack_require__(909),
- ReverseRows: __webpack_require__(910),
- Rotate180: __webpack_require__(911),
- RotateLeft: __webpack_require__(912),
- RotateMatrix: __webpack_require__(127),
- RotateRight: __webpack_require__(913),
- TransposeMatrix: __webpack_require__(382)
+ CheckMatrix: __webpack_require__(190),
+ MatrixToString: __webpack_require__(920),
+ ReverseColumns: __webpack_require__(921),
+ ReverseRows: __webpack_require__(922),
+ Rotate180: __webpack_require__(923),
+ RotateLeft: __webpack_require__(924),
+ RotateMatrix: __webpack_require__(132),
+ RotateRight: __webpack_require__(925),
+ TransposeMatrix: __webpack_require__(390)
};
/***/ }),
-/* 908 */
+/* 920 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -138571,8 +142280,8 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Pad = __webpack_require__(160);
-var CheckMatrix = __webpack_require__(182);
+var Pad = __webpack_require__(168);
+var CheckMatrix = __webpack_require__(190);
/**
* Generates a string (which you can pass to console.log) from the given Array Matrix.
@@ -138643,7 +142352,7 @@ module.exports = MatrixToString;
/***/ }),
-/* 909 */
+/* 921 */
/***/ (function(module, exports) {
/**
@@ -138674,7 +142383,7 @@ module.exports = ReverseColumns;
/***/ }),
-/* 910 */
+/* 922 */
/***/ (function(module, exports) {
/**
@@ -138710,7 +142419,7 @@ module.exports = ReverseRows;
/***/ }),
-/* 911 */
+/* 923 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -138719,7 +142428,7 @@ module.exports = ReverseRows;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RotateMatrix = __webpack_require__(127);
+var RotateMatrix = __webpack_require__(132);
/**
* Rotates the array matrix 180 degrees.
@@ -138743,7 +142452,7 @@ module.exports = Rotate180;
/***/ }),
-/* 912 */
+/* 924 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -138752,7 +142461,7 @@ module.exports = Rotate180;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RotateMatrix = __webpack_require__(127);
+var RotateMatrix = __webpack_require__(132);
/**
* Rotates the array matrix to the left (or 90 degrees)
@@ -138776,7 +142485,7 @@ module.exports = RotateLeft;
/***/ }),
-/* 913 */
+/* 925 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -138785,7 +142494,7 @@ module.exports = RotateLeft;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RotateMatrix = __webpack_require__(127);
+var RotateMatrix = __webpack_require__(132);
/**
* Rotates the array matrix to the left (or -90 degrees)
@@ -138809,7 +142518,7 @@ module.exports = RotateRight;
/***/ }),
-/* 914 */
+/* 926 */
/***/ (function(module, exports) {
/**
@@ -138926,7 +142635,7 @@ module.exports = Add;
/***/ }),
-/* 915 */
+/* 927 */
/***/ (function(module, exports) {
/**
@@ -139048,7 +142757,7 @@ module.exports = AddAt;
/***/ }),
-/* 916 */
+/* 928 */
/***/ (function(module, exports) {
/**
@@ -139086,7 +142795,7 @@ module.exports = BringToTop;
/***/ }),
-/* 917 */
+/* 929 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -139138,7 +142847,7 @@ module.exports = CountAllMatching;
/***/ }),
-/* 918 */
+/* 930 */
/***/ (function(module, exports) {
/**
@@ -139184,7 +142893,7 @@ module.exports = Each;
/***/ }),
-/* 919 */
+/* 931 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -139240,128 +142949,7 @@ module.exports = EachInRange;
/***/ }),
-/* 920 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/**
- * @author Richard Davey
- * @copyright 2020 Photon Storm Ltd.
- * @license {@link https://opensource.org/licenses/MIT|MIT License}
- */
-
-var SafeRange = __webpack_require__(68);
-
-/**
- * Returns all elements in the array.
- *
- * You can optionally specify a matching criteria using the `property` and `value` arguments.
- *
- * For example: `getAll('visible', true)` would return only elements that have their visible property set.
- *
- * Optionally you can specify a start and end index. For example if the array had 100 elements,
- * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only
- * the first 50 elements.
- *
- * @function Phaser.Utils.Array.GetAll
- * @since 3.4.0
- *
- * @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.
- *
- * @return {array} All matching elements from the array.
- */
-var GetAll = function (array, property, value, startIndex, endIndex)
-{
- if (startIndex === undefined) { startIndex = 0; }
- if (endIndex === undefined) { endIndex = array.length; }
-
- var output = [];
-
- if (SafeRange(array, startIndex, endIndex))
- {
- for (var i = startIndex; i < endIndex; i++)
- {
- var child = array[i];
-
- if (!property ||
- (property && value === undefined && child.hasOwnProperty(property)) ||
- (property && value !== undefined && child[property] === value))
- {
- output.push(child);
- }
- }
- }
-
- return output;
-};
-
-module.exports = GetAll;
-
-
-/***/ }),
-/* 921 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/**
- * @author Richard Davey
- * @copyright 2020 Photon Storm Ltd.
- * @license {@link https://opensource.org/licenses/MIT|MIT License}
- */
-
-var SafeRange = __webpack_require__(68);
-
-/**
- * Returns the first element in the array.
- *
- * You can optionally specify a matching criteria using the `property` and `value` arguments.
- *
- * For example: `getAll('visible', true)` would return the first element that had its `visible` property set.
- *
- * Optionally you can specify a start and end index. For example if the array had 100 elements,
- * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements.
- *
- * @function Phaser.Utils.Array.GetFirst
- * @since 3.4.0
- *
- * @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)
- *
- * @return {object} The first matching element from the array, or `null` if no element could be found in the range given.
- */
-var GetFirst = function (array, property, value, startIndex, endIndex)
-{
- if (startIndex === undefined) { startIndex = 0; }
- if (endIndex === undefined) { endIndex = array.length; }
-
- if (SafeRange(array, startIndex, endIndex))
- {
- for (var i = startIndex; i < endIndex; i++)
- {
- var child = array[i];
-
- if (!property ||
- (property && value === undefined && child.hasOwnProperty(property)) ||
- (property && value !== undefined && child[property] === value))
- {
- return child;
- }
- }
- }
-
- return null;
-};
-
-module.exports = GetFirst;
-
-
-/***/ }),
-/* 922 */
+/* 932 */
/***/ (function(module, exports) {
/**
@@ -139403,7 +142991,7 @@ module.exports = MoveDown;
/***/ }),
-/* 923 */
+/* 933 */
/***/ (function(module, exports) {
/**
@@ -139450,7 +143038,7 @@ module.exports = MoveTo;
/***/ }),
-/* 924 */
+/* 934 */
/***/ (function(module, exports) {
/**
@@ -139492,7 +143080,7 @@ module.exports = MoveUp;
/***/ }),
-/* 925 */
+/* 935 */
/***/ (function(module, exports) {
/**
@@ -139556,7 +143144,7 @@ module.exports = NumberArray;
/***/ }),
-/* 926 */
+/* 936 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -139565,7 +143153,7 @@ module.exports = NumberArray;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RoundAwayFromZero = __webpack_require__(328);
+var RoundAwayFromZero = __webpack_require__(336);
/**
* Create an array of numbers (positive and/or negative) progressing from `start`
@@ -139633,7 +143221,7 @@ module.exports = NumberArrayStep;
/***/ }),
-/* 927 */
+/* 937 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -139642,7 +143230,7 @@ module.exports = NumberArrayStep;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var SpliceOne = __webpack_require__(79);
+var SpliceOne = __webpack_require__(80);
/**
* Removes the item from the given position in the array.
@@ -139684,7 +143272,7 @@ module.exports = RemoveAt;
/***/ }),
-/* 928 */
+/* 938 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -139747,7 +143335,7 @@ module.exports = RemoveBetween;
/***/ }),
-/* 929 */
+/* 939 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -139756,7 +143344,7 @@ module.exports = RemoveBetween;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var SpliceOne = __webpack_require__(79);
+var SpliceOne = __webpack_require__(80);
/**
* Removes a random object from the given array and returns it.
@@ -139785,7 +143373,7 @@ module.exports = RemoveRandomElement;
/***/ }),
-/* 930 */
+/* 940 */
/***/ (function(module, exports) {
/**
@@ -139829,7 +143417,7 @@ module.exports = Replace;
/***/ }),
-/* 931 */
+/* 941 */
/***/ (function(module, exports) {
/**
@@ -139867,7 +143455,7 @@ module.exports = SendToBack;
/***/ }),
-/* 932 */
+/* 942 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -139922,7 +143510,7 @@ module.exports = SetAll;
/***/ }),
-/* 933 */
+/* 943 */
/***/ (function(module, exports) {
/**
@@ -139970,7 +143558,7 @@ module.exports = Swap;
/***/ }),
-/* 934 */
+/* 944 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -139980,9 +143568,9 @@ module.exports = Swap;
*/
var Class = __webpack_require__(0);
-var ProcessQueue = __webpack_require__(184);
+var ProcessQueue = __webpack_require__(192);
var PluginCache = __webpack_require__(23);
-var SceneEvents = __webpack_require__(19);
+var SceneEvents = __webpack_require__(22);
/**
* @classdesc
@@ -140271,7 +143859,7 @@ module.exports = UpdateList;
/***/ }),
-/* 935 */
+/* 945 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -140286,14 +143874,14 @@ module.exports = UpdateList;
module.exports = {
- PROCESS_QUEUE_ADD: __webpack_require__(936),
- PROCESS_QUEUE_REMOVE: __webpack_require__(937)
+ PROCESS_QUEUE_ADD: __webpack_require__(946),
+ PROCESS_QUEUE_REMOVE: __webpack_require__(947)
};
/***/ }),
-/* 936 */
+/* 946 */
/***/ (function(module, exports) {
/**
@@ -140320,7 +143908,7 @@ module.exports = 'add';
/***/ }),
-/* 937 */
+/* 947 */
/***/ (function(module, exports) {
/**
@@ -140347,7 +143935,7 @@ module.exports = 'remove';
/***/ }),
-/* 938 */
+/* 948 */
/***/ (function(module, exports) {
/**
@@ -140357,10 +143945,10 @@ module.exports = 'remove';
*/
/**
- * Calculate the position, width and height of a BitmapText Game Object.
+ * Calculate the full bounds, in local and world space, of a BitmapText Game Object.
*
* Returns a BitmapTextSize object that contains global and local variants of the Game Objects x and y coordinates and
- * its width and height.
+ * its width and height. Also includes an array of the line lengths and all word positions.
*
* The global position and size take into account the Game Object's position and scale.
*
@@ -140370,14 +143958,17 @@ module.exports = 'remove';
* @since 3.0.0
* @private
*
- * @param {(Phaser.GameObjects.DynamicBitmapText|Phaser.GameObjects.BitmapText)} src - The BitmapText to calculate the position, width and height of.
- * @param {boolean} [round] - Whether to round the results to the nearest integer.
- * @param {object} [out] - Optional object to store the results in, to save constant object creation.
+ * @param {(Phaser.GameObjects.DynamicBitmapText|Phaser.GameObjects.BitmapText)} src - The BitmapText to calculate the bounds values for.
+ * @param {boolean} [round=false] - Whether to round the positions to the nearest integer.
+ * @param {boolean} [updateOrigin=false] - Whether to update the origin of the BitmapText after bounds calculations?
+ * @param {object} [out] - Object to store the results in, to save constant object creation. If not provided an empty object is returned.
*
- * @return {Phaser.Types.GameObjects.BitmapText.BitmapTextSize} The calculated position, width and height of the BitmapText.
+ * @return {Phaser.Types.GameObjects.BitmapText.BitmapTextSize} The calculated bounds values of the BitmapText.
*/
-var GetBitmapTextSize = function (src, round, out)
+var GetBitmapTextSize = function (src, round, updateOrigin, out)
{
+ if (updateOrigin === undefined) { updateOrigin = false; }
+
if (out === undefined)
{
out = {
@@ -140401,6 +143992,7 @@ var GetBitmapTextSize = function (src, round, out)
},
wrappedText: '',
words: [],
+ characters: [],
scaleX: 0,
scaleY: 0
};
@@ -140429,6 +144021,8 @@ var GetBitmapTextSize = function (src, round, out)
var glyph = null;
+ var align = src._align;
+
var x = 0;
var y = 0;
@@ -140446,6 +144040,7 @@ var GetBitmapTextSize = function (src, round, out)
var i;
var words = [];
+ var characters = [];
var current = null;
// Scan for breach of maxWidth and insert carriage-returns
@@ -140504,7 +144099,7 @@ var GetBitmapTextSize = function (src, round, out)
h: current.h * sy,
cr: false
});
-
+
current = null;
}
}
@@ -140613,6 +144208,8 @@ var GetBitmapTextSize = function (src, round, out)
current = null;
}
+ var charIndex = 0;
+
for (i = 0; i < textLength; i++)
{
charCode = text.charCodeAt(i);
@@ -140695,6 +144292,8 @@ var GetBitmapTextSize = function (src, round, out)
bh = gh;
}
+ var charWidth = glyph.xOffset + glyph.xAdvance + ((kerningOffset !== undefined) ? kerningOffset : 0);
+
if (charCode === wordWrapCharCode)
{
if (current !== null)
@@ -140707,7 +144306,7 @@ var GetBitmapTextSize = function (src, round, out)
w: current.w * sx,
h: current.h * sy
});
-
+
current = null;
}
}
@@ -140716,17 +144315,33 @@ var GetBitmapTextSize = function (src, round, out)
if (current === null)
{
// We're starting a new word, recording the starting index, etc
- current = { word: '', i: i, x: xAdvance, y: yAdvance, w: 0, h: lineHeight };
+ current = { word: '', i: charIndex, x: xAdvance, y: yAdvance, w: 0, h: lineHeight };
}
current.word = current.word.concat(text[i]);
- current.w += glyph.xOffset + glyph.xAdvance + ((kerningOffset !== undefined) ? kerningOffset : 0);
+ current.w += charWidth;
}
+ characters.push({
+ i: charIndex,
+ char: text[i],
+ code: charCode,
+ x: (glyph.xOffset + xAdvance) * scale,
+ y: (glyph.yOffset + yAdvance) * scale,
+ w: glyph.width * scale,
+ h: glyph.height * scale,
+ t: yAdvance * scale,
+ r: gw * scale,
+ b: lineHeight * scale,
+ line: currentLine,
+ glyph: glyph
+ });
+
xAdvance += glyph.xAdvance + letterSpacing;
lastGlyph = glyph;
lastCharCode = charCode;
currentLineWidth = gw * scale;
+ charIndex++;
}
// Last word
@@ -140754,6 +144369,30 @@ var GetBitmapTextSize = function (src, round, out)
shortestLine = currentLineWidth;
}
+ // Adjust all of the character positions based on alignment
+ if (align > 0)
+ {
+ for (var c = 0; c < characters.length; c++)
+ {
+ var currentChar = characters[c];
+
+ if (align === 1)
+ {
+ var ax1 = ((longestLine - lineWidths[currentChar.line]) / 2);
+
+ currentChar.x += ax1;
+ currentChar.r += ax1;
+ }
+ else if (align === 2)
+ {
+ var ax2 = (longestLine - lineWidths[currentChar.line]);
+
+ currentChar.x += ax2;
+ currentChar.r += ax2;
+ }
+ }
+ }
+
var local = out.local;
var global = out.global;
var lines = out.lines;
@@ -140763,8 +144402,9 @@ var GetBitmapTextSize = function (src, round, out)
local.width = bw * scale;
local.height = bh * scale;
- global.x = (src.x - src.displayOriginX) + (bx * sx);
- global.y = (src.y - src.displayOriginY) + (by * sy);
+ global.x = (src.x - src._displayOriginX) + (bx * sx);
+ global.y = (src.y - src._displayOriginY) + (by * sy);
+
global.width = bw * sx;
global.height = bh * sy;
@@ -140774,22 +144414,39 @@ var GetBitmapTextSize = function (src, round, out)
if (round)
{
- local.x = Math.round(local.x);
- local.y = Math.round(local.y);
- local.width = Math.round(local.width);
- local.height = Math.round(local.height);
+ local.x = Math.ceil(local.x);
+ local.y = Math.ceil(local.y);
+ local.width = Math.ceil(local.width);
+ local.height = Math.ceil(local.height);
- global.x = Math.round(global.x);
- global.y = Math.round(global.y);
- global.width = Math.round(global.width);
- global.height = Math.round(global.height);
+ global.x = Math.ceil(global.x);
+ global.y = Math.ceil(global.y);
+ global.width = Math.ceil(global.width);
+ global.height = Math.ceil(global.height);
- lines.shortest = Math.round(shortestLine);
- lines.longest = Math.round(longestLine);
+ lines.shortest = Math.ceil(shortestLine);
+ lines.longest = Math.ceil(longestLine);
+ }
+
+ if (updateOrigin)
+ {
+ src._displayOriginX = (src.originX * local.width);
+ src._displayOriginY = (src.originY * local.height);
+
+ global.x = src.x - (src._displayOriginX * src.scaleX);
+ global.y = src.y - (src._displayOriginY * src.scaleY);
+
+ if (round)
+ {
+ global.x = Math.ceil(global.x);
+ global.y = Math.ceil(global.y);
+ }
}
out.words = words;
+ out.characters = characters;
out.lines.height = lineHeight;
+ out.scale = scale;
out.scaleX = src.scaleX;
out.scaleY = src.scaleY;
@@ -140800,7 +144457,7 @@ module.exports = GetBitmapTextSize;
/***/ }),
-/* 939 */
+/* 949 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -140809,7 +144466,7 @@ module.exports = GetBitmapTextSize;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ParseXMLBitmapFont = __webpack_require__(185);
+var ParseXMLBitmapFont = __webpack_require__(193);
/**
* Parse an XML Bitmap Font from an Atlas.
@@ -140832,12 +144489,13 @@ var ParseXMLBitmapFont = __webpack_require__(185);
*/
var ParseFromAtlas = function (scene, fontName, textureKey, frameKey, xmlKey, xSpacing, ySpacing)
{
- var frame = scene.sys.textures.getFrame(textureKey, frameKey);
+ var texture = scene.sys.textures.get(textureKey);
+ var frame = texture.get(frameKey);
var xml = scene.sys.cache.xml.get(xmlKey);
if (frame && xml)
{
- var data = ParseXMLBitmapFont(xml, xSpacing, ySpacing, frame);
+ var data = ParseXMLBitmapFont(xml, frame, xSpacing, ySpacing, texture);
scene.sys.cache.bitmapFont.add(fontName, { data: data, texture: textureKey, frame: frameKey });
@@ -140853,7 +144511,7 @@ module.exports = ParseFromAtlas;
/***/ }),
-/* 940 */
+/* 950 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -140867,12 +144525,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(941);
+ renderWebGL = __webpack_require__(951);
}
if (true)
{
- renderCanvas = __webpack_require__(942);
+ renderCanvas = __webpack_require__(953);
}
module.exports = {
@@ -140884,7 +144542,7 @@ module.exports = {
/***/ }),
-/* 941 */
+/* 951 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -140893,6 +144551,7 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
+var BatchChar = __webpack_require__(952);
var Utils = __webpack_require__(10);
/**
@@ -140919,7 +144578,7 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
{
return;
}
-
+
var pipeline = this.pipeline;
renderer.setPipeline(pipeline, src);
@@ -140953,166 +144612,89 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
camMatrix.multiply(spriteMatrix, calcMatrix);
}
- 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 roundPixels = camera.roundPixels;
+
+ var cameraAlpha = camera.alpha;
+
+ var charColors = src.charColors;
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);
- pipeline.setTexture2D(texture, 0);
+ 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 xAdvance = 0;
- var yAdvance = 0;
- var charCode = 0;
- var lastCharCode = 0;
- var letterSpacing = src._letterSpacing;
- var glyph;
- var glyphX = 0;
- var glyphY = 0;
- var glyphW = 0;
- var glyphH = 0;
- var lastGlyph;
-
- var fontData = src.fontData;
- var chars = fontData.chars;
- var lineHeight = fontData.lineHeight;
- var scale = (src._fontSize / fontData.size);
-
- var align = src._align;
- var currentLine = 0;
- var lineOffsetX = 0;
+ var texture = src.frame.glTexture;
+ var textureUnit = pipeline.setGameObject(src);
// Update the bounds - skipped internally if not dirty
var bounds = src.getTextBounds(false);
- // In case the method above changed it (word wrapping)
- if (src.maxWidth > 0)
+ var i;
+ var char;
+ var glyph;
+
+ var characters = bounds.characters;
+
+ var dropShadowX = src.dropShadowX;
+ var dropShadowY = src.dropShadowY;
+
+ var dropShadow = (dropShadowX !== 0 || dropShadowY !== 0);
+
+ if (dropShadow)
{
- text = bounds.wrappedText;
- textLength = text.length;
- }
+ var srcShadowColor = src._dropShadowColorGL;
+ var srcShadowAlpha = src.dropShadowAlpha;
- var lineData = src._bounds.lines;
+ var blackTL = Utils.getTintAppendFloatAlpha(srcShadowColor, cameraAlpha * srcShadowAlpha * src._alphaTL);
+ var blackTR = Utils.getTintAppendFloatAlpha(srcShadowColor, cameraAlpha * srcShadowAlpha * src._alphaTR);
+ var blackBL = Utils.getTintAppendFloatAlpha(srcShadowColor, cameraAlpha * srcShadowAlpha * src._alphaBL);
+ var blackBR = Utils.getTintAppendFloatAlpha(srcShadowColor, cameraAlpha * srcShadowAlpha * src._alphaBR);
- if (align === 1)
- {
- lineOffsetX = (lineData.longest - lineData.lengths[0]) / 2;
- }
- else if (align === 2)
- {
- lineOffsetX = (lineData.longest - lineData.lengths[0]);
- }
-
- var roundPixels = camera.roundPixels;
-
- for (var i = 0; i < textLength; i++)
- {
- charCode = text.charCodeAt(i);
-
- // Carriage-return
- if (charCode === 10)
+ for (i = 0; i < characters.length; i++)
{
- currentLine++;
+ char = characters[i];
+ glyph = char.glyph;
- if (align === 1)
+ if (char.code === 32 || glyph.width === 0 || glyph.height === 0)
{
- lineOffsetX = (lineData.longest - lineData.lengths[currentLine]) / 2;
+ continue;
}
- else if (align === 2)
- {
- lineOffsetX = (lineData.longest - lineData.lengths[currentLine]);
- }
-
- xAdvance = 0;
- yAdvance += lineHeight;
- lastGlyph = null;
-
- continue;
+
+ BatchChar(pipeline, src, char, glyph, dropShadowX, dropShadowY, calcMatrix, roundPixels, blackTL, blackTR, blackBL, blackBR, 0, texture, textureUnit);
}
+ }
- glyph = chars[charCode];
+ for (i = 0; i < characters.length; i++)
+ {
+ char = characters[i];
+ glyph = char.glyph;
- if (!glyph)
+ if (char.code === 32 || glyph.width === 0 || glyph.height === 0)
{
continue;
}
- glyphX = textureX + glyph.x;
- glyphY = textureY + glyph.y;
-
- glyphW = glyph.width;
- glyphH = glyph.height;
-
- var x = glyph.xOffset + xAdvance;
- var y = glyph.yOffset + yAdvance;
-
- if (lastGlyph !== null)
+ if (charColors[char.i])
{
- var kerningOffset = glyph.kerning[lastCharCode];
- x += (kerningOffset !== undefined) ? kerningOffset : 0;
+ var color = charColors[char.i];
+
+ var ctintEffect = color.tintEffect;
+ var ctintTL = Utils.getTintAppendFloatAlpha(color.tintTL, cameraAlpha * src._alphaTL);
+ var ctintTR = Utils.getTintAppendFloatAlpha(color.tintTR, cameraAlpha * src._alphaTR);
+ var ctintBL = Utils.getTintAppendFloatAlpha(color.tintBL, cameraAlpha * src._alphaBL);
+ var ctintBR = Utils.getTintAppendFloatAlpha(color.tintBR, cameraAlpha * src._alphaBR);
+
+ BatchChar(pipeline, src, char, glyph, 0, 0, calcMatrix, roundPixels, ctintTL, ctintTR, ctintBL, ctintBR, ctintEffect, texture, textureUnit);
+ }
+ else
+ {
+ BatchChar(pipeline, src, char, glyph, 0, 0, calcMatrix, roundPixels, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit);
}
- xAdvance += glyph.xAdvance + letterSpacing;
- lastGlyph = glyph;
- lastCharCode = charCode;
-
- // Nothing to render or a space? Then skip to the next glyph
- if (glyphW === 0 || glyphH === 0 || charCode === 32)
- {
- continue;
- }
-
- x *= scale;
- y *= scale;
-
- x -= src.displayOriginX;
- y -= src.displayOriginY;
-
- x += lineOffsetX;
-
- var u0 = glyphX / textureWidth;
- var v0 = glyphY / textureHeight;
- var u1 = (glyphX + glyphW) / textureWidth;
- var v1 = (glyphY + glyphH) / textureHeight;
-
- var xw = x + (glyphW * scale);
- var yh = y + (glyphH * scale);
-
- 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);
- }
-
- pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0);
+ // Debug test if the characters are in the correct place when rendered:
+ // pipeline.drawFillRect(tx0, ty0, tx2 - tx0, ty2 - ty0, 0x00ff00, 0.5);
}
};
@@ -141120,7 +144702,66 @@ module.exports = BitmapTextWebGLRenderer;
/***/ }),
-/* 942 */
+/* 952 */
+/***/ (function(module, exports) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+/**
+ * Renders one character of the Bitmap Text to the WebGL Pipeline.
+ *
+ * @function BatchChar
+ * @since 3.50.0
+ * @private
+ *
+ * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The BitmapText Game Object.
+ * @param {Phaser.GameObjects.BitmapText} src - The BitmapText Game Object.
+ * @param {Phaser.Types.GameObjects.BitmapText.BitmapTextCharacter} char - The character to render.
+ * @param {Phaser.Types.GameObjects.BitmapText.BitmapFontCharacterData} glyph - The character glyph.
+ * @param {number} offsetX - The x offset.
+ * @param {number} offsetY - The y offset.
+ * @param {Phaser.GameObjects.Components.TransformMatrix} calcMatrix - The transform matrix.
+ * @param {boolean} roundPixels - Round the transform values or not?
+ * @param {number} tintTL - Top-left tint value.
+ * @param {number} tintTR - Top-right tint value.
+ * @param {number} tintBL - Bottom-left tint value.
+ * @param {number} tintBR - Bottom-right tint value.
+ * @param {number} tintEffect - The tint effect mode.
+ * @param {WebGLTexture} texture - The WebGL texture.
+ * @param {number} textureUnit - The texture unit.
+ */
+var BatchChar = function (pipeline, src, char, glyph, offsetX, offsetY, calcMatrix, roundPixels, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit)
+{
+ var x = (char.x - src.displayOriginX) + offsetX;
+ var y = (char.y - src.displayOriginY) + offsetY;
+
+ var xw = x + char.w;
+ var yh = y + char.h;
+
+ 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);
+
+ 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);
+};
+
+module.exports = BatchChar;
+
+
+/***/ }),
+/* 953 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -141129,7 +144770,7 @@ module.exports = BitmapTextWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var SetTransform = __webpack_require__(27);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -141302,7 +144943,7 @@ module.exports = BitmapTextCanvasRenderer;
/***/ }),
-/* 943 */
+/* 954 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -141316,12 +144957,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(944);
+ renderWebGL = __webpack_require__(955);
}
if (true)
{
- renderCanvas = __webpack_require__(945);
+ renderCanvas = __webpack_require__(956);
}
module.exports = {
@@ -141333,7 +144974,7 @@ module.exports = {
/***/ }),
-/* 944 */
+/* 955 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -141437,7 +145078,7 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam
// Bind texture only if the Texture Source is different from before
if (frame.sourceIndex !== prevTextureSourceIndex)
{
- pipeline.setTexture2D(frame.glTexture, 0);
+ var textureUnit = pipeline.setGameObject(src, frame);
prevTextureSourceIndex = frame.sourceIndex;
}
@@ -141452,7 +145093,7 @@ 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, 0))
+ 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))
{
prevTextureSourceIndex = -1;
}
@@ -141463,7 +145104,7 @@ module.exports = BlitterWebGLRenderer;
/***/ }),
-/* 945 */
+/* 956 */
/***/ (function(module, exports) {
/**
@@ -141593,7 +145234,7 @@ module.exports = BlitterCanvasRenderer;
/***/ }),
-/* 946 */
+/* 957 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -141603,7 +145244,7 @@ module.exports = BlitterCanvasRenderer;
*/
var Class = __webpack_require__(0);
-var Frame = __webpack_require__(94);
+var Frame = __webpack_require__(95);
/**
* @classdesc
@@ -141750,7 +145391,7 @@ var Bob = new Class({
*
* @param {(string|integer|Phaser.Textures.Frame)} [frame] - The frame to be used during rendering.
*
- * @return {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
setFrame: function (frame)
{
@@ -141776,7 +145417,7 @@ var Bob = new Class({
* @method Phaser.GameObjects.Bob#resetFlip
* @since 3.0.0
*
- * @return {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
resetFlip: function ()
{
@@ -141800,7 +145441,7 @@ var Bob = new Class({
* @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.
*
- * @return {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
reset: function (x, y, frame)
{
@@ -141832,7 +145473,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.
*
- * @return {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
setPosition: function (x, y)
{
@@ -141850,7 +145491,7 @@ var Bob = new Class({
*
* @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.
*
- * @return {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
setFlipX: function (value)
{
@@ -141867,7 +145508,7 @@ var Bob = new Class({
*
* @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.
*
- * @return {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
setFlipY: function (value)
{
@@ -141885,7 +145526,7 @@ var Bob = new Class({
* @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 {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
setFlip: function (x, y)
{
@@ -141905,7 +145546,7 @@ var Bob = new Class({
*
* @param {boolean} value - The visible state of the Game Object.
*
- * @return {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
setVisible: function (value)
{
@@ -141925,7 +145566,7 @@ var Bob = new Class({
*
* @param {number} value - The alpha value used for this Bob. Between 0 and 1.
*
- * @return {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
setAlpha: function (value)
{
@@ -141942,7 +145583,7 @@ var Bob = new Class({
*
* @param {number} value - The tint value used for this Bob. Between 0 and 0xffffff.
*
- * @return {Phaser.GameObjects.Bob} This Bob Game Object.
+ * @return {this} This Bob Game Object.
*/
setTint: function (value)
{
@@ -142023,7 +145664,7 @@ module.exports = Bob;
/***/ }),
-/* 947 */
+/* 958 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -142038,12 +145679,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(948);
+ renderWebGL = __webpack_require__(959);
}
if (true)
{
- renderCanvas = __webpack_require__(949);
+ renderCanvas = __webpack_require__(960);
}
module.exports = {
@@ -142055,7 +145696,7 @@ module.exports = {
/***/ }),
-/* 948 */
+/* 959 */
/***/ (function(module, exports) {
/**
@@ -142204,7 +145845,7 @@ module.exports = ContainerWebGLRenderer;
/***/ }),
-/* 949 */
+/* 960 */
/***/ (function(module, exports) {
/**
@@ -142239,7 +145880,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen
}
var transformMatrix = container.localTransform;
-
+
if (parentMatrix)
{
transformMatrix.loadIdentity();
@@ -142265,6 +145906,11 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen
var scrollFactorX = container.scrollFactorX;
var scrollFactorY = container.scrollFactorY;
+ if (container.mask)
+ {
+ container.mask.preRenderCanvas(renderer, null, camera);
+ }
+
for (var i = 0; i < children.length; i++)
{
var child = children[i];
@@ -142295,13 +145941,18 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen
child.setAlpha(childAlpha);
child.setScrollFactor(childScrollFactorX, childScrollFactorY);
}
+
+ if (container.mask)
+ {
+ container.mask.postRenderCanvas(renderer);
+ }
};
module.exports = ContainerCanvasRenderer;
/***/ }),
-/* 950 */
+/* 961 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -142315,12 +145966,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(388);
+ renderWebGL = __webpack_require__(396);
}
if (true)
{
- renderCanvas = __webpack_require__(388);
+ renderCanvas = __webpack_require__(396);
}
module.exports = {
@@ -142332,7 +145983,7 @@ module.exports = {
/***/ }),
-/* 951 */
+/* 962 */
/***/ (function(module, exports) {
/**
@@ -142373,7 +146024,7 @@ module.exports = [
/***/ }),
-/* 952 */
+/* 963 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -142387,12 +146038,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(953);
+ renderWebGL = __webpack_require__(964);
}
if (true)
{
- renderCanvas = __webpack_require__(954);
+ renderCanvas = __webpack_require__(965);
}
module.exports = {
@@ -142404,7 +146055,7 @@ module.exports = {
/***/ }),
-/* 953 */
+/* 964 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -142414,6 +146065,7 @@ module.exports = {
*/
var Utils = __webpack_require__(10);
+var GetColorFromValue = __webpack_require__(114);
/**
* Renders this Game Object with the WebGL Renderer to the given Camera.
@@ -142444,20 +146096,6 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce
renderer.setPipeline(pipeline, src);
- var crop = (src.cropWidth > 0 || src.cropHeight > 0);
-
- if (crop)
- {
- pipeline.flush();
-
- renderer.pushScissor(
- src.x,
- src.y,
- src.cropWidth * src.scaleX,
- src.cropHeight * src.scaleY
- );
- }
-
var camMatrix = pipeline._tempMatrix1;
var spriteMatrix = pipeline._tempMatrix2;
var calcMatrix = pipeline._tempMatrix3;
@@ -142488,6 +146126,20 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce
camMatrix.multiply(spriteMatrix, calcMatrix);
}
+ var crop = (src.cropWidth > 0 || src.cropHeight > 0);
+
+ if (crop)
+ {
+ pipeline.flush();
+
+ renderer.pushScissor(
+ calcMatrix.tx,
+ calcMatrix.ty,
+ src.cropWidth * calcMatrix.scaleX,
+ src.cropHeight * calcMatrix.scaleY
+ );
+ }
+
var frame = src.frame;
var texture = frame.glTexture;
var textureX = frame.cutX;
@@ -142501,7 +146153,7 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce
var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, camera.alpha * src._alphaBL);
var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, camera.alpha * src._alphaBR);
- pipeline.setTexture2D(texture, 0);
+ var textureUnit = pipeline.setGameObject(src);
var xAdvance = 0;
var yAdvance = 0;
@@ -142642,10 +146294,10 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce
tintBR = output.tint.bottomRight;
}
- 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);
+ 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);
}
x *= scale;
@@ -142695,7 +146347,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, 0);
+ pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit);
}
if (crop)
@@ -142710,7 +146362,7 @@ module.exports = DynamicBitmapTextWebGLRenderer;
/***/ }),
-/* 954 */
+/* 965 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -142719,7 +146371,7 @@ module.exports = DynamicBitmapTextWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var SetTransform = __webpack_require__(27);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -142921,7 +146573,7 @@ module.exports = DynamicBitmapTextCanvasRenderer;
/***/ }),
-/* 955 */
+/* 966 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -142935,12 +146587,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(956);
+ renderWebGL = __webpack_require__(967);
}
if (true)
{
- renderCanvas = __webpack_require__(957);
+ renderCanvas = __webpack_require__(968);
}
module.exports = {
@@ -142952,7 +146604,7 @@ module.exports = {
/***/ }),
-/* 956 */
+/* 967 */
/***/ (function(module, exports) {
/**
@@ -143021,13 +146673,13 @@ module.exports = ExternWebGLRenderer;
/***/ }),
-/* 957 */
+/* 968 */
/***/ (function(module, exports) {
/***/ }),
-/* 958 */
+/* 969 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -143041,15 +146693,15 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(959);
+ renderWebGL = __webpack_require__(970);
// Needed for Graphics.generateTexture
- renderCanvas = __webpack_require__(393);
+ renderCanvas = __webpack_require__(401);
}
if (true)
{
- renderCanvas = __webpack_require__(393);
+ renderCanvas = __webpack_require__(401);
}
module.exports = {
@@ -143061,7 +146713,7 @@ module.exports = {
/***/ }),
-/* 959 */
+/* 970 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -143070,7 +146722,7 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Commands = __webpack_require__(190);
+var Commands = __webpack_require__(198);
var Utils = __webpack_require__(10);
// TODO: Remove the use of this
@@ -143170,7 +146822,8 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca
var getTint = Utils.getTintAppendFloatAlphaAndSwap;
- var currentTexture = renderer.blankTexture.glTexture;
+ // Set to a white texture, not a blank one, so Lights2D works too!
+ var currentTexture = renderer.tempTextures[0];
for (var cmdIndex = 0; cmdIndex < commands.length; cmdIndex++)
{
@@ -143198,7 +146851,7 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca
case Commands.FILL_PATH:
for (pathIndex = 0; pathIndex < path.length; pathIndex++)
{
- pipeline.setTexture2D(currentTexture);
+ pipeline.setTexture2D(currentTexture, src);
pipeline.batchFillPath(
path[pathIndex].points,
@@ -143211,7 +146864,7 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca
case Commands.STROKE_PATH:
for (pathIndex = 0; pathIndex < path.length; pathIndex++)
{
- pipeline.setTexture2D(currentTexture);
+ pipeline.setTexture2D(currentTexture, src);
pipeline.batchStrokePath(
path[pathIndex].points,
@@ -143320,7 +146973,7 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca
break;
case Commands.FILL_RECT:
- pipeline.setTexture2D(currentTexture);
+ pipeline.setTexture2D(currentTexture, src);
pipeline.batchFillRect(
commands[++cmdIndex],
commands[++cmdIndex],
@@ -143332,7 +146985,7 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca
break;
case Commands.FILL_TRIANGLE:
- pipeline.setTexture2D(currentTexture);
+ pipeline.setTexture2D(currentTexture, src);
pipeline.batchFillTriangle(
commands[++cmdIndex],
commands[++cmdIndex],
@@ -143346,7 +146999,7 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca
break;
case Commands.STROKE_TRIANGLE:
- pipeline.setTexture2D(currentTexture);
+ pipeline.setTexture2D(currentTexture, src);
pipeline.batchStrokeTriangle(
commands[++cmdIndex],
commands[++cmdIndex],
@@ -143406,7 +147059,7 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca
var mode = commands[++cmdIndex];
pipeline.currentFrame = frame;
- pipeline.setTexture2D(frame.glTexture, 0);
+ pipeline.setTexture2D(frame.glTexture, src);
pipeline.tintEffect = mode;
currentTexture = frame.glTexture;
@@ -143416,7 +147069,7 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca
case Commands.CLEAR_TEXTURE:
pipeline.currentFrame = renderer.blankTexture;
pipeline.tintEffect = 2;
- currentTexture = renderer.blankTexture.glTexture;
+ currentTexture = renderer.tempTextures[0];
break;
}
}
@@ -143426,7 +147079,7 @@ module.exports = GraphicsWebGLRenderer;
/***/ }),
-/* 960 */
+/* 971 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -143440,12 +147093,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(961);
+ renderWebGL = __webpack_require__(972);
}
if (true)
{
- renderCanvas = __webpack_require__(962);
+ renderCanvas = __webpack_require__(973);
}
module.exports = {
@@ -143457,7 +147110,7 @@ module.exports = {
/***/ }),
-/* 961 */
+/* 972 */
/***/ (function(module, exports) {
/**
@@ -143490,7 +147143,7 @@ module.exports = SpriteWebGLRenderer;
/***/ }),
-/* 962 */
+/* 973 */
/***/ (function(module, exports) {
/**
@@ -143523,7 +147176,7 @@ module.exports = SpriteCanvasRenderer;
/***/ }),
-/* 963 */
+/* 974 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -143537,12 +147190,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(964);
+ renderWebGL = __webpack_require__(975);
}
if (true)
{
- renderCanvas = __webpack_require__(965);
+ renderCanvas = __webpack_require__(976);
}
module.exports = {
@@ -143554,7 +147207,7 @@ module.exports = {
/***/ }),
-/* 964 */
+/* 975 */
/***/ (function(module, exports) {
/**
@@ -143587,7 +147240,7 @@ module.exports = ImageWebGLRenderer;
/***/ }),
-/* 965 */
+/* 976 */
/***/ (function(module, exports) {
/**
@@ -143620,7 +147273,7 @@ module.exports = ImageCanvasRenderer;
/***/ }),
-/* 966 */
+/* 977 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -143635,17 +147288,17 @@ module.exports = ImageCanvasRenderer;
module.exports = {
- GravityWell: __webpack_require__(394),
- Particle: __webpack_require__(395),
- ParticleEmitter: __webpack_require__(396),
- ParticleEmitterManager: __webpack_require__(192),
- Zones: __webpack_require__(971)
+ GravityWell: __webpack_require__(402),
+ Particle: __webpack_require__(403),
+ ParticleEmitter: __webpack_require__(404),
+ ParticleEmitterManager: __webpack_require__(200),
+ Zones: __webpack_require__(982)
};
/***/ }),
-/* 967 */
+/* 978 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -143655,8 +147308,8 @@ module.exports = {
*/
var Class = __webpack_require__(0);
-var FloatBetween = __webpack_require__(326);
-var GetEaseFunction = __webpack_require__(82);
+var FloatBetween = __webpack_require__(121);
+var GetEaseFunction = __webpack_require__(69);
var GetFastValue = __webpack_require__(2);
var Wrap = __webpack_require__(58);
@@ -143859,7 +147512,7 @@ var EmitterOp = new Class({
*
* @param {number} value - The value of the property.
*
- * @return {Phaser.GameObjects.Particles.EmitterOp} This Emitter Op object.
+ * @return {this} This Emitter Op object.
*/
onChange: function (value)
{
@@ -143876,7 +147529,7 @@ var EmitterOp = new Class({
* @method Phaser.GameObjects.Particles.EmitterOp#setMethods
* @since 3.0.0
*
- * @return {Phaser.GameObjects.Particles.EmitterOp} This Emitter Op object.
+ * @return {this} This Emitter Op object.
*/
setMethods: function ()
{
@@ -144236,7 +147889,7 @@ module.exports = EmitterOp;
/***/ }),
-/* 968 */
+/* 979 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -144250,12 +147903,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(969);
+ renderWebGL = __webpack_require__(980);
}
if (true)
{
- renderCanvas = __webpack_require__(970);
+ renderCanvas = __webpack_require__(981);
}
module.exports = {
@@ -144267,7 +147920,7 @@ module.exports = {
/***/ }),
-/* 969 */
+/* 980 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -144318,7 +147971,7 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola
var texture = emitterManager.defaultFrame.glTexture;
var getTint = Utils.getTintAppendFloatAlphaAndSwap;
- pipeline.setTexture2D(texture, 0);
+ var textureUnit = pipeline.setGameObject(emitterManager, emitterManager.defaultFrame);
for (var e = 0; e < emittersLength; e++)
{
@@ -144346,15 +147999,16 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola
if (renderer.setBlendMode(emitter.blendMode))
{
// Rebind the texture if we've flushed
- pipeline.setTexture2D(texture, 0);
+ // pipeline.setTexture2D(texture, 0);
}
if (emitter.mask)
{
emitter.mask.preRenderWebGL(renderer, emitter, camera);
- pipeline.setTexture2D(texture, 0);
+
+ // pipeline.setTexture2D(texture, 0);
}
-
+
var tintEffect = 0;
for (var i = 0; i < particleCount; i++)
@@ -144384,13 +148038,13 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola
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);
@@ -144398,26 +148052,27 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola
{
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 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, 0);
+ 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);
}
if (emitter.mask)
{
emitter.mask.postRenderWebGL(renderer, camera);
- pipeline.setTexture2D(texture, 0);
+
+ // pipeline.setTexture2D(texture, 0);
}
}
};
@@ -144426,7 +148081,7 @@ module.exports = ParticleManagerWebGLRenderer;
/***/ }),
-/* 970 */
+/* 981 */
/***/ (function(module, exports) {
/**
@@ -144549,7 +148204,7 @@ module.exports = ParticleManagerCanvasRenderer;
/***/ }),
-/* 971 */
+/* 982 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -144564,15 +148219,15 @@ module.exports = ParticleManagerCanvasRenderer;
module.exports = {
- DeathZone: __webpack_require__(397),
- EdgeZone: __webpack_require__(398),
- RandomZone: __webpack_require__(400)
+ DeathZone: __webpack_require__(405),
+ EdgeZone: __webpack_require__(406),
+ RandomZone: __webpack_require__(408)
};
/***/ }),
-/* 972 */
+/* 983 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -144586,12 +148241,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(973);
+ renderWebGL = __webpack_require__(984);
}
if (true)
{
- renderCanvas = __webpack_require__(974);
+ renderCanvas = __webpack_require__(985);
}
module.exports = {
@@ -144603,7 +148258,7 @@ module.exports = {
/***/ }),
-/* 973 */
+/* 984 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -144635,8 +148290,13 @@ var RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentag
var width = frame.width;
var height = frame.height;
var getTint = Utils.getTintAppendFloatAlpha;
+ var pipeline = src.pipeline;
- this.pipeline.batchTexture(
+ renderer.setPipeline(pipeline, src);
+
+ var textureUnit = pipeline.setTexture2D(frame.glTexture, src);
+
+ pipeline.batchTexture(
src,
frame.glTexture,
width, height,
@@ -144655,18 +148315,17 @@ var RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentag
(src._isTinted && src.tintFill),
0, 0,
camera,
- parentMatrix
+ parentMatrix,
+ false,
+ textureUnit
);
-
- // Force clear the current texture so that items next in the batch (like Graphics) don't try and use it
- renderer.setBlankTexture(true);
};
module.exports = RenderTextureWebGLRenderer;
/***/ }),
-/* 974 */
+/* 985 */
/***/ (function(module, exports) {
/**
@@ -144699,7 +148358,7 @@ module.exports = RenderTextureCanvasRenderer;
/***/ }),
-/* 975 */
+/* 986 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -144708,15 +148367,15 @@ module.exports = RenderTextureCanvasRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RETRO_FONT_CONST = __webpack_require__(976);
-var Extend = __webpack_require__(17);
+var RETRO_FONT_CONST = __webpack_require__(987);
+var Extend = __webpack_require__(19);
/**
* @namespace Phaser.GameObjects.RetroFont
* @since 3.6.0
*/
-var RetroFont = { Parse: __webpack_require__(977) };
+var RetroFont = { Parse: __webpack_require__(988) };
// Merge in the consts
RetroFont = Extend(false, RetroFont, RETRO_FONT_CONST);
@@ -144725,7 +148384,7 @@ module.exports = RetroFont;
/***/ }),
-/* 976 */
+/* 987 */
/***/ (function(module, exports) {
/**
@@ -144841,7 +148500,7 @@ module.exports = RETRO_FONT_CONST;
/***/ }),
-/* 977 */
+/* 988 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -144957,7 +148616,204 @@ module.exports = ParseRetroFont;
/***/ }),
-/* 978 */
+/* 989 */
+/***/ (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__(990);
+}
+
+if (true)
+{
+ renderCanvas = __webpack_require__(991);
+}
+
+module.exports = {
+
+ renderWebGL: renderWebGL,
+ renderCanvas: renderCanvas
+
+};
+
+
+/***/ }),
+/* 990 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @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.Rope#renderWebGL
+ * @since 3.23.0
+ * @private
+ *
+ * @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 pipeline = src.pipeline;
+
+ renderer.setPipeline(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 alpha = src.alpha;
+ var getTint = Utils.getTintAppendFloatAlphaAndSwap;
+ var roundPixels = camera.roundPixels;
+
+ var meshVerticesLength = vertices.length;
+ var vertexCount = Math.floor(meshVerticesLength * 0.5);
+
+ // Because it's a triangle strip and we don't want lots of degenerate triangles joining things up
+ 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;
+
+ if (src.dirty)
+ {
+ src.updateVertices();
+ }
+
+ var debugCallback = src.debugCallback;
+ var debugVerts = [];
+
+ 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 (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] = getTint(colors[colorIndex], camera.alpha * (alphas[colorIndex] * alpha));
+
+ colorIndex++;
+
+ if (debugCallback)
+ {
+ debugVerts[i + 0] = tx;
+ debugVerts[i + 1] = ty;
+ }
+ }
+
+ if (debugCallback)
+ {
+ debugCallback.call(src, src, meshVerticesLength, debugVerts);
+ }
+
+ pipeline.vertexCount += vertexCount;
+};
+
+module.exports = RopeWebGLRenderer;
+
+
+/***/ }),
+/* 991 */
+/***/ (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 Rope.Render. There is no Canvas renderer for Rope objects.
+ *
+ * @method Phaser.GameObjects.Rope#renderCanvas
+ * @since 3.23.0
+ * @private
+ *
+ * @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 ()
+{
+};
+
+module.exports = RopeCanvasRenderer;
+
+
+/***/ }),
+/* 992 */
/***/ (function(module, exports) {
/**
@@ -145039,7 +148895,7 @@ module.exports = GetTextSize;
/***/ }),
-/* 979 */
+/* 993 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -145053,12 +148909,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(980);
+ renderWebGL = __webpack_require__(994);
}
if (true)
{
- renderCanvas = __webpack_require__(981);
+ renderCanvas = __webpack_require__(995);
}
module.exports = {
@@ -145070,7 +148926,7 @@ module.exports = {
/***/ }),
-/* 980 */
+/* 994 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -145098,7 +148954,7 @@ var Utils = __webpack_require__(10);
*/
var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)
{
- if ((src.width === 0) || (src.height === 0))
+ if (src.width === 0 || src.height === 0)
{
return;
}
@@ -145107,8 +148963,13 @@ var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera
var width = frame.width;
var height = frame.height;
var getTint = Utils.getTintAppendFloatAlpha;
+ var pipeline = this.pipeline;
- this.pipeline.batchTexture(
+ renderer.setPipeline(pipeline, src);
+
+ var textureUnit = pipeline.setTexture2D(frame.glTexture, src);
+
+ pipeline.batchTexture(
src,
frame.glTexture,
width, height,
@@ -145127,7 +148988,9 @@ var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera
(src._isTinted && src.tintFill),
0, 0,
camera,
- parentMatrix
+ parentMatrix,
+ false,
+ textureUnit
);
};
@@ -145135,7 +148998,7 @@ module.exports = TextWebGLRenderer;
/***/ }),
-/* 981 */
+/* 995 */
/***/ (function(module, exports) {
/**
@@ -145173,7 +149036,7 @@ module.exports = TextCanvasRenderer;
/***/ }),
-/* 982 */
+/* 996 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -145185,7 +149048,7 @@ module.exports = TextCanvasRenderer;
var Class = __webpack_require__(0);
var GetAdvancedValue = __webpack_require__(15);
var GetValue = __webpack_require__(6);
-var MeasureText = __webpack_require__(983);
+var MeasureText = __webpack_require__(997);
// Key: [ Object Key, Default Value ]
@@ -145221,7 +149084,7 @@ var propertyMap = {
/**
* @classdesc
* A TextStyle class manages all of the style settings for a Text object.
- *
+ *
* Text Game Objects create a TextStyle instance automatically, which is
* accessed via the `Text.style` property. You do not normally need to
* instantiate one yourself.
@@ -145472,6 +149335,58 @@ var TextStyle = new Class({
*/
this.baselineY;
+ /**
+ * The maximum width of a line of text in pixels. Null means no line wrapping. Setting this
+ * property directly will not re-run the word wrapping algorithm. To change the width and
+ * re-wrap, use {@link Phaser.GameObjects.TextStyle#setWordWrapWidth}.
+ *
+ * @name Phaser.GameObjects.TextStyle#wordWrapWidth
+ * @type {number | null}
+ * @default null
+ * @since 3.24.0
+ */
+ this.wordWrapWidth;
+
+ /**
+ * A custom function that will be responsible for wrapping the text. It will receive two
+ * arguments: text (the string to wrap), textObject (this Text instance). It should return
+ * the wrapped lines either as an array of lines or as a string with newline characters in
+ * place to indicate where breaks should happen. Setting this directly will not re-run the
+ * word wrapping algorithm. To change the callback and re-wrap, use
+ * {@link Phaser.GameObjects.TextStyle#setWordWrapCallback}.
+ *
+ * @name Phaser.GameObjects.TextStyle#wordWrapCallback
+ * @type {TextStyleWordWrapCallback | null}
+ * @default null
+ * @since 3.24.0
+ */
+ this.wordWrapCallback;
+
+ /**
+ * The scope that will be applied when the wordWrapCallback is invoked. Setting this directly will not re-run the
+ * word wrapping algorithm. To change the callback and re-wrap, use
+ * {@link Phaser.GameObjects.TextStyle#setWordWrapCallback}.
+ *
+ * @name Phaser.GameObjects.TextStyle#wordWrapCallbackScope
+ * @type {object | null}
+ * @default null
+ * @since 3.24.0
+ */
+ this.wordWrapCallbackScope;
+
+ /**
+ * Whether or not to use the advanced wrapping algorithm. If true, spaces are collapsed and
+ * whitespace is trimmed from lines. If false, spaces and whitespace are left as is. Setting
+ * this property directly will not re-run the word wrapping algorithm. To change the
+ * advanced setting and re-wrap, use {@link Phaser.GameObjects.TextStyle#setWordWrapWidth}.
+ *
+ * @name Phaser.GameObjects.TextStyle#wordWrapUseAdvanced
+ * @type {boolean}
+ * @default false
+ * @since 3.24.0
+ */
+ this.wordWrapUseAdvanced;
+
/**
* The font style, size and family.
*
@@ -145530,6 +149445,7 @@ var TextStyle = new Class({
if (setDefaults === undefined) { setDefaults = false; }
// Avoid type mutation
+ // eslint-disable-next-line no-prototype-builtins
if (style && style.hasOwnProperty('fontSize') && typeof style.fontSize === 'number')
{
style.fontSize = style.fontSize.toString() + 'px';
@@ -145894,7 +149810,7 @@ var TextStyle = 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. 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.
- *
+ *
* Please use with caution, as the more high res Text you have, the more memory it uses up.
*
* @method Phaser.GameObjects.TextStyle#setResolution
@@ -145946,7 +149862,7 @@ var TextStyle = new Class({
/**
* Set the shadow settings.
- *
+ *
* Calling this method always re-measures the parent Text object,
* so only call it when you actually change the shadow settings.
*
@@ -146128,9 +150044,9 @@ var TextStyle = 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.TextStyle#setAlign
@@ -146226,7 +150142,7 @@ module.exports = TextStyle;
/***/ }),
-/* 983 */
+/* 997 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146361,7 +150277,7 @@ module.exports = MeasureText;
/***/ }),
-/* 984 */
+/* 998 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146375,12 +150291,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(985);
+ renderWebGL = __webpack_require__(999);
}
if (true)
{
- renderCanvas = __webpack_require__(986);
+ renderCanvas = __webpack_require__(1000);
}
module.exports = {
@@ -146392,7 +150308,7 @@ module.exports = {
/***/ }),
-/* 985 */
+/* 999 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146422,20 +150338,32 @@ var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage,
{
src.updateCanvas();
+ var width = src.width;
+ var height = src.height;
var getTint = Utils.getTintAppendFloatAlpha;
+ var pipeline = this.pipeline;
- this.pipeline.batchTexture(
+ if (width === 0 || height === 0)
+ {
+ return;
+ }
+
+ renderer.setPipeline(pipeline, src);
+
+ var textureUnit = pipeline.setTexture2D(src.fillPattern, src);
+
+ pipeline.batchTexture(
src,
src.fillPattern,
src.displayFrame.width * src.tileScaleX, src.displayFrame.height * src.tileScaleY,
src.x, src.y,
- src.width, src.height,
+ width, height,
src.scaleX, src.scaleY,
src.rotation,
src.flipX, src.flipY,
src.scrollFactorX, src.scrollFactorY,
- src.originX * src.width, src.originY * src.height,
- 0, 0, src.width, src.height,
+ 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),
@@ -146444,7 +150372,9 @@ var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage,
(src.tilePositionX % src.displayFrame.width) / src.displayFrame.width,
(src.tilePositionY % src.displayFrame.height) / src.displayFrame.height,
camera,
- parentMatrix
+ parentMatrix,
+ false,
+ textureUnit
);
};
@@ -146452,7 +150382,7 @@ module.exports = TileSpriteWebGLRenderer;
/***/ }),
-/* 986 */
+/* 1000 */
/***/ (function(module, exports) {
/**
@@ -146487,7 +150417,7 @@ module.exports = TileSpriteCanvasRenderer;
/***/ }),
-/* 987 */
+/* 1001 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146501,12 +150431,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(988);
+ renderWebGL = __webpack_require__(1002);
}
if (true)
{
- renderCanvas = __webpack_require__(989);
+ renderCanvas = __webpack_require__(1003);
}
module.exports = {
@@ -146518,7 +150448,7 @@ module.exports = {
/***/ }),
-/* 988 */
+/* 1002 */
/***/ (function(module, exports) {
/**
@@ -146554,7 +150484,7 @@ module.exports = VideoWebGLRenderer;
/***/ }),
-/* 989 */
+/* 1003 */
/***/ (function(module, exports) {
/**
@@ -146590,7 +150520,7 @@ module.exports = VideoCanvasRenderer;
/***/ }),
-/* 990 */
+/* 1004 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146604,12 +150534,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(991);
+ renderWebGL = __webpack_require__(1005);
}
if (true)
{
- renderCanvas = __webpack_require__(992);
+ renderCanvas = __webpack_require__(1006);
}
module.exports = {
@@ -146621,7 +150551,7 @@ module.exports = {
/***/ }),
-/* 991 */
+/* 1005 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146630,7 +150560,7 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillPathWebGL = __webpack_require__(100);
+var FillPathWebGL = __webpack_require__(99);
var StrokePathWebGL = __webpack_require__(70);
/**
@@ -146699,7 +150629,7 @@ module.exports = ArcWebGLRenderer;
/***/ }),
-/* 992 */
+/* 1006 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146708,10 +150638,10 @@ module.exports = ArcWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var DegToRad = __webpack_require__(35);
-var FillStyleCanvas = __webpack_require__(36);
-var LineStyleCanvas = __webpack_require__(49);
-var SetTransform = __webpack_require__(27);
+var DegToRad = __webpack_require__(39);
+var FillStyleCanvas = __webpack_require__(41);
+var LineStyleCanvas = __webpack_require__(50);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -146775,7 +150705,7 @@ module.exports = ArcCanvasRenderer;
/***/ }),
-/* 993 */
+/* 1007 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146789,12 +150719,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(994);
+ renderWebGL = __webpack_require__(1008);
}
if (true)
{
- renderCanvas = __webpack_require__(995);
+ renderCanvas = __webpack_require__(1009);
}
module.exports = {
@@ -146806,7 +150736,7 @@ module.exports = {
/***/ }),
-/* 994 */
+/* 1008 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146815,7 +150745,7 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillPathWebGL = __webpack_require__(100);
+var FillPathWebGL = __webpack_require__(99);
var StrokePathWebGL = __webpack_require__(70);
/**
@@ -146884,7 +150814,7 @@ module.exports = CurveWebGLRenderer;
/***/ }),
-/* 995 */
+/* 1009 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146893,9 +150823,9 @@ module.exports = CurveWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillStyleCanvas = __webpack_require__(36);
-var LineStyleCanvas = __webpack_require__(49);
-var SetTransform = __webpack_require__(27);
+var FillStyleCanvas = __webpack_require__(41);
+var LineStyleCanvas = __webpack_require__(50);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -146972,7 +150902,7 @@ module.exports = CurveCanvasRenderer;
/***/ }),
-/* 996 */
+/* 1010 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -146986,12 +150916,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(997);
+ renderWebGL = __webpack_require__(1011);
}
if (true)
{
- renderCanvas = __webpack_require__(998);
+ renderCanvas = __webpack_require__(1012);
}
module.exports = {
@@ -147003,7 +150933,7 @@ module.exports = {
/***/ }),
-/* 997 */
+/* 1011 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -147012,7 +150942,7 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillPathWebGL = __webpack_require__(100);
+var FillPathWebGL = __webpack_require__(99);
var StrokePathWebGL = __webpack_require__(70);
/**
@@ -147081,7 +151011,7 @@ module.exports = EllipseWebGLRenderer;
/***/ }),
-/* 998 */
+/* 1012 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -147090,9 +151020,9 @@ module.exports = EllipseWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillStyleCanvas = __webpack_require__(36);
-var LineStyleCanvas = __webpack_require__(49);
-var SetTransform = __webpack_require__(27);
+var FillStyleCanvas = __webpack_require__(41);
+var LineStyleCanvas = __webpack_require__(50);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -147166,7 +151096,7 @@ module.exports = EllipseCanvasRenderer;
/***/ }),
-/* 999 */
+/* 1013 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -147180,12 +151110,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1000);
+ renderWebGL = __webpack_require__(1014);
}
if (true)
{
- renderCanvas = __webpack_require__(1001);
+ renderCanvas = __webpack_require__(1015);
}
module.exports = {
@@ -147197,7 +151127,7 @@ module.exports = {
/***/ }),
-/* 1000 */
+/* 1014 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -147288,6 +151218,8 @@ 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)
@@ -147309,7 +151241,7 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera
{
fillTint = pipeline.fillTint;
fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha);
-
+
fillTint.TL = fillTintColor;
fillTint.TR = fillTintColor;
fillTint.BL = fillTintColor;
@@ -147335,8 +151267,6 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera
cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB;
ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB;
- pipeline.setTexture2D();
-
pipeline.batchFillRect(
x * cellWidth,
y * cellHeight,
@@ -147351,7 +151281,7 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera
{
fillTint = pipeline.fillTint;
fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.altFillColor, src.altFillAlpha * alpha);
-
+
fillTint.TL = fillTintColor;
fillTint.TR = fillTintColor;
fillTint.BL = fillTintColor;
@@ -147377,8 +151307,6 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera
cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB;
ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB;
- pipeline.setTexture2D();
-
pipeline.batchFillRect(
x * cellWidth,
y * cellHeight,
@@ -147403,8 +151331,6 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera
{
var x1 = x * cellWidth;
- pipeline.setTexture2D();
-
pipeline.batchLine(x1, 0, x1, height, 1, 1, 1, 0, false);
}
@@ -147412,8 +151338,6 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera
{
var y1 = y * cellHeight;
- pipeline.setTexture2D();
-
pipeline.batchLine(0, y1, width, y1, 1, 1, 1, 0, false);
}
}
@@ -147423,7 +151347,7 @@ module.exports = GridWebGLRenderer;
/***/ }),
-/* 1001 */
+/* 1015 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -147432,9 +151356,9 @@ module.exports = GridWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillStyleCanvas = __webpack_require__(36);
-var LineStyleCanvas = __webpack_require__(49);
-var SetTransform = __webpack_require__(27);
+var FillStyleCanvas = __webpack_require__(41);
+var LineStyleCanvas = __webpack_require__(50);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -147612,7 +151536,7 @@ module.exports = GridCanvasRenderer;
/***/ }),
-/* 1002 */
+/* 1016 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -147626,12 +151550,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1003);
+ renderWebGL = __webpack_require__(1017);
}
if (true)
{
- renderCanvas = __webpack_require__(1004);
+ renderCanvas = __webpack_require__(1018);
}
module.exports = {
@@ -147643,7 +151567,7 @@ module.exports = {
/***/ }),
-/* 1003 */
+/* 1017 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -147727,6 +151651,8 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came
var x3;
var y3;
+ pipeline.setTexture2D();
+
// Top Face
if (src.showTop)
@@ -147735,18 +151661,16 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came
x0 = calcMatrix.getX(-sizeA, -height);
y0 = calcMatrix.getY(-sizeA, -height);
-
+
x1 = calcMatrix.getX(0, -sizeB - height);
y1 = calcMatrix.getY(0, -sizeB - height);
-
+
x2 = calcMatrix.getX(sizeA, -height);
y2 = calcMatrix.getY(sizeA, -height);
-
+
x3 = calcMatrix.getX(0, sizeB - height);
y3 = calcMatrix.getY(0, sizeB - height);
- pipeline.setTexture2D();
-
pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2);
}
@@ -147758,18 +151682,16 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came
x0 = calcMatrix.getX(-sizeA, 0);
y0 = calcMatrix.getY(-sizeA, 0);
-
+
x1 = calcMatrix.getX(0, sizeB);
y1 = calcMatrix.getY(0, sizeB);
-
+
x2 = calcMatrix.getX(0, sizeB - height);
y2 = calcMatrix.getY(0, sizeB - height);
-
+
x3 = calcMatrix.getX(-sizeA, -height);
y3 = calcMatrix.getY(-sizeA, -height);
- pipeline.setTexture2D();
-
pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2);
}
@@ -147781,18 +151703,16 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came
x0 = calcMatrix.getX(sizeA, 0);
y0 = calcMatrix.getY(sizeA, 0);
-
+
x1 = calcMatrix.getX(0, sizeB);
y1 = calcMatrix.getY(0, sizeB);
-
+
x2 = calcMatrix.getX(0, sizeB - height);
y2 = calcMatrix.getY(0, sizeB - height);
-
+
x3 = calcMatrix.getX(sizeA, -height);
y3 = calcMatrix.getY(sizeA, -height);
- pipeline.setTexture2D();
-
pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2);
}
};
@@ -147801,7 +151721,7 @@ module.exports = IsoBoxWebGLRenderer;
/***/ }),
-/* 1004 */
+/* 1018 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -147810,8 +151730,8 @@ module.exports = IsoBoxWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillStyleCanvas = __webpack_require__(36);
-var SetTransform = __webpack_require__(27);
+var FillStyleCanvas = __webpack_require__(41);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -147902,7 +151822,7 @@ module.exports = IsoBoxCanvasRenderer;
/***/ }),
-/* 1005 */
+/* 1019 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -147916,12 +151836,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1006);
+ renderWebGL = __webpack_require__(1020);
}
if (true)
{
- renderCanvas = __webpack_require__(1007);
+ renderCanvas = __webpack_require__(1021);
}
module.exports = {
@@ -147933,7 +151853,7 @@ module.exports = {
/***/ }),
-/* 1006 */
+/* 1020 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148016,6 +151936,8 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage,
var x2;
var y2;
+ pipeline.setTexture2D();
+
// Top Face
if (src.showTop && reversed)
@@ -148024,18 +151946,16 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage,
x0 = calcMatrix.getX(-sizeA, -height);
y0 = calcMatrix.getY(-sizeA, -height);
-
+
x1 = calcMatrix.getX(0, -sizeB - height);
y1 = calcMatrix.getY(0, -sizeB - height);
-
+
x2 = calcMatrix.getX(sizeA, -height);
y2 = calcMatrix.getY(sizeA, -height);
-
+
var x3 = calcMatrix.getX(0, sizeB - height);
var y3 = calcMatrix.getY(0, sizeB - height);
- pipeline.setTexture2D();
-
pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2);
}
@@ -148049,10 +151969,10 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage,
{
x0 = calcMatrix.getX(-sizeA, -height);
y0 = calcMatrix.getY(-sizeA, -height);
-
+
x1 = calcMatrix.getX(0, sizeB);
y1 = calcMatrix.getY(0, sizeB);
-
+
x2 = calcMatrix.getX(0, sizeB - height);
y2 = calcMatrix.getY(0, sizeB - height);
}
@@ -148060,14 +151980,14 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage,
{
x0 = calcMatrix.getX(-sizeA, 0);
y0 = calcMatrix.getY(-sizeA, 0);
-
+
x1 = calcMatrix.getX(0, sizeB);
y1 = calcMatrix.getY(0, sizeB);
-
+
x2 = calcMatrix.getX(0, sizeB - height);
y2 = calcMatrix.getY(0, sizeB - height);
}
-
+
pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2);
}
@@ -148081,10 +152001,10 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage,
{
x0 = calcMatrix.getX(sizeA, -height);
y0 = calcMatrix.getY(sizeA, -height);
-
+
x1 = calcMatrix.getX(0, sizeB);
y1 = calcMatrix.getY(0, sizeB);
-
+
x2 = calcMatrix.getX(0, sizeB - height);
y2 = calcMatrix.getY(0, sizeB - height);
}
@@ -148092,16 +152012,14 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage,
{
x0 = calcMatrix.getX(sizeA, 0);
y0 = calcMatrix.getY(sizeA, 0);
-
+
x1 = calcMatrix.getX(0, sizeB);
y1 = calcMatrix.getY(0, sizeB);
-
+
x2 = calcMatrix.getX(0, sizeB - height);
y2 = calcMatrix.getY(0, sizeB - height);
}
- pipeline.setTexture2D();
-
pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2);
}
};
@@ -148110,7 +152028,7 @@ module.exports = IsoTriangleWebGLRenderer;
/***/ }),
-/* 1007 */
+/* 1021 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148119,8 +152037,8 @@ module.exports = IsoTriangleWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillStyleCanvas = __webpack_require__(36);
-var SetTransform = __webpack_require__(27);
+var FillStyleCanvas = __webpack_require__(41);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -148224,7 +152142,7 @@ module.exports = IsoTriangleCanvasRenderer;
/***/ }),
-/* 1008 */
+/* 1022 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148238,12 +152156,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1009);
+ renderWebGL = __webpack_require__(1023);
}
if (true)
{
- renderCanvas = __webpack_require__(1010);
+ renderCanvas = __webpack_require__(1024);
}
module.exports = {
@@ -148255,7 +152173,7 @@ module.exports = {
/***/ }),
-/* 1009 */
+/* 1023 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148348,7 +152266,7 @@ module.exports = LineWebGLRenderer;
/***/ }),
-/* 1010 */
+/* 1024 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148357,8 +152275,8 @@ module.exports = LineWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var LineStyleCanvas = __webpack_require__(49);
-var SetTransform = __webpack_require__(27);
+var LineStyleCanvas = __webpack_require__(50);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -148405,7 +152323,7 @@ module.exports = LineCanvasRenderer;
/***/ }),
-/* 1011 */
+/* 1025 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148419,12 +152337,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1012);
+ renderWebGL = __webpack_require__(1026);
}
if (true)
{
- renderCanvas = __webpack_require__(1013);
+ renderCanvas = __webpack_require__(1027);
}
module.exports = {
@@ -148436,7 +152354,7 @@ module.exports = {
/***/ }),
-/* 1012 */
+/* 1026 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148445,7 +152363,7 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillPathWebGL = __webpack_require__(100);
+var FillPathWebGL = __webpack_require__(99);
var StrokePathWebGL = __webpack_require__(70);
/**
@@ -148514,7 +152432,7 @@ module.exports = PolygonWebGLRenderer;
/***/ }),
-/* 1013 */
+/* 1027 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148523,9 +152441,9 @@ module.exports = PolygonWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillStyleCanvas = __webpack_require__(36);
-var LineStyleCanvas = __webpack_require__(49);
-var SetTransform = __webpack_require__(27);
+var FillStyleCanvas = __webpack_require__(41);
+var LineStyleCanvas = __webpack_require__(50);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -148599,7 +152517,7 @@ module.exports = PolygonCanvasRenderer;
/***/ }),
-/* 1014 */
+/* 1028 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148613,12 +152531,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1015);
+ renderWebGL = __webpack_require__(1029);
}
if (true)
{
- renderCanvas = __webpack_require__(1016);
+ renderCanvas = __webpack_require__(1030);
}
module.exports = {
@@ -148630,7 +152548,7 @@ module.exports = {
/***/ }),
-/* 1015 */
+/* 1029 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148722,7 +152640,7 @@ module.exports = RectangleWebGLRenderer;
/***/ }),
-/* 1016 */
+/* 1030 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148731,9 +152649,9 @@ module.exports = RectangleWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillStyleCanvas = __webpack_require__(36);
-var LineStyleCanvas = __webpack_require__(49);
-var SetTransform = __webpack_require__(27);
+var FillStyleCanvas = __webpack_require__(41);
+var LineStyleCanvas = __webpack_require__(50);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -148796,7 +152714,7 @@ module.exports = RectangleCanvasRenderer;
/***/ }),
-/* 1017 */
+/* 1031 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148810,12 +152728,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1018);
+ renderWebGL = __webpack_require__(1032);
}
if (true)
{
- renderCanvas = __webpack_require__(1019);
+ renderCanvas = __webpack_require__(1033);
}
module.exports = {
@@ -148827,7 +152745,7 @@ module.exports = {
/***/ }),
-/* 1018 */
+/* 1032 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148836,7 +152754,7 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillPathWebGL = __webpack_require__(100);
+var FillPathWebGL = __webpack_require__(99);
var StrokePathWebGL = __webpack_require__(70);
/**
@@ -148905,7 +152823,7 @@ module.exports = StarWebGLRenderer;
/***/ }),
-/* 1019 */
+/* 1033 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -148914,9 +152832,9 @@ module.exports = StarWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillStyleCanvas = __webpack_require__(36);
-var LineStyleCanvas = __webpack_require__(49);
-var SetTransform = __webpack_require__(27);
+var FillStyleCanvas = __webpack_require__(41);
+var LineStyleCanvas = __webpack_require__(50);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -148990,7 +152908,7 @@ module.exports = StarCanvasRenderer;
/***/ }),
-/* 1020 */
+/* 1034 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149004,12 +152922,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1021);
+ renderWebGL = __webpack_require__(1035);
}
if (true)
{
- renderCanvas = __webpack_require__(1022);
+ renderCanvas = __webpack_require__(1036);
}
module.exports = {
@@ -149021,7 +152939,7 @@ module.exports = {
/***/ }),
-/* 1021 */
+/* 1035 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149124,7 +153042,7 @@ module.exports = TriangleWebGLRenderer;
/***/ }),
-/* 1022 */
+/* 1036 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149133,9 +153051,9 @@ module.exports = TriangleWebGLRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var FillStyleCanvas = __webpack_require__(36);
-var LineStyleCanvas = __webpack_require__(49);
-var SetTransform = __webpack_require__(27);
+var FillStyleCanvas = __webpack_require__(41);
+var LineStyleCanvas = __webpack_require__(50);
+var SetTransform = __webpack_require__(28);
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
@@ -149199,7 +153117,7 @@ module.exports = TriangleCanvasRenderer;
/***/ }),
-/* 1023 */
+/* 1037 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149208,7 +153126,7 @@ module.exports = TriangleCanvasRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Blitter = __webpack_require__(186);
+var Blitter = __webpack_require__(194);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149241,7 +153159,7 @@ GameObjectFactory.register('blitter', function (x, y, key, frame)
/***/ }),
-/* 1024 */
+/* 1038 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149251,7 +153169,7 @@ GameObjectFactory.register('blitter', function (x, y, key, frame)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Container = __webpack_require__(187);
+var Container = __webpack_require__(195);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149262,8 +153180,8 @@ var GameObjectFactory = __webpack_require__(5);
* @method Phaser.GameObjects.GameObjectFactory#container
* @since 3.4.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} [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 {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Container.
*
* @return {Phaser.GameObjects.Container} The Game Object that was created.
@@ -149275,7 +153193,7 @@ GameObjectFactory.register('container', function (x, y, children)
/***/ }),
-/* 1025 */
+/* 1039 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149284,7 +153202,7 @@ GameObjectFactory.register('container', function (x, y, children)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var DOMElement = __webpack_require__(387);
+var DOMElement = __webpack_require__(395);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149365,7 +153283,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText)
/***/ }),
-/* 1026 */
+/* 1040 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149374,7 +153292,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var DynamicBitmapText = __webpack_require__(188);
+var DynamicBitmapText = __webpack_require__(196);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149434,7 +153352,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size
/***/ }),
-/* 1027 */
+/* 1041 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149443,7 +153361,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Extern = __webpack_require__(389);
+var Extern = __webpack_require__(397);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149476,7 +153394,7 @@ GameObjectFactory.register('extern', function ()
/***/ }),
-/* 1028 */
+/* 1042 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149485,7 +153403,7 @@ GameObjectFactory.register('extern', function ()
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Graphics = __webpack_require__(189);
+var Graphics = __webpack_require__(197);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149515,7 +153433,7 @@ GameObjectFactory.register('graphics', function (config)
/***/ }),
-/* 1029 */
+/* 1043 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149524,7 +153442,7 @@ GameObjectFactory.register('graphics', function (config)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Group = __webpack_require__(97);
+var Group = __webpack_require__(98);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149547,7 +153465,7 @@ GameObjectFactory.register('group', function (children, config)
/***/ }),
-/* 1030 */
+/* 1044 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149556,7 +153474,7 @@ GameObjectFactory.register('group', function (children, config)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Image = __webpack_require__(98);
+var Image = __webpack_require__(108);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149569,7 +153487,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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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.Image} The Game Object that was created.
@@ -149589,7 +153507,7 @@ GameObjectFactory.register('image', function (x, y, key, frame)
/***/ }),
-/* 1031 */
+/* 1045 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149599,7 +153517,7 @@ GameObjectFactory.register('image', function (x, y, key, frame)
*/
var GameObjectFactory = __webpack_require__(5);
-var ParticleEmitterManager = __webpack_require__(192);
+var ParticleEmitterManager = __webpack_require__(200);
/**
* Creates a new Particle Emitter Manager Game Object and adds it to the Scene.
@@ -149609,7 +153527,7 @@ var ParticleEmitterManager = __webpack_require__(192);
* @method Phaser.GameObjects.GameObjectFactory#particles
* @since 3.0.0
*
- * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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 {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create.
*
@@ -149635,7 +153553,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters)
/***/ }),
-/* 1032 */
+/* 1046 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149645,7 +153563,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters)
*/
var GameObjectFactory = __webpack_require__(5);
-var PathFollower = __webpack_require__(401);
+var PathFollower = __webpack_require__(409);
/**
* Creates a new PathFollower Game Object and adds it to the Scene.
@@ -149658,7 +153576,7 @@ var PathFollower = __webpack_require__(401);
* @param {Phaser.Curves.Path} path - The Path this PathFollower is connected to.
* @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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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.PathFollower} The Game Object that was created.
@@ -149683,7 +153601,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame)
/***/ }),
-/* 1033 */
+/* 1047 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149693,7 +153611,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame)
*/
var GameObjectFactory = __webpack_require__(5);
-var RenderTexture = __webpack_require__(193);
+var RenderTexture = __webpack_require__(201);
/**
* Creates a new Render Texture Game Object and adds it to the Scene.
@@ -149723,7 +153641,61 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key,
/***/ }),
-/* 1034 */
+/* 1048 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+var Rope = __webpack_require__(203);
+var GameObjectFactory = __webpack_require__(5);
+
+/**
+ * Creates a new Rope Game Object and adds it to the Scene.
+ *
+ * Note: This method will only be available if the Rope Game Object and WebGL support have been built into Phaser.
+ *
+ * @method Phaser.GameObjects.GameObjectFactory#rope
+ * @webglOnly
+ * @since 3.23.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.
+ * @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.
+ * @param {number[]} [alphas] - An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices.
+ *
+ * @return {Phaser.GameObjects.Rope} The Game Object that was created.
+ */
+if (true)
+{
+ GameObjectFactory.register('rope', function (x, y, texture, frame, points, horizontal, colors, alphas)
+ {
+ var rope = new Rope(this.scene, x, y, texture, frame, points, horizontal, colors, alphas);
+
+ this.displayList.add(rope);
+
+ return this.updateList.add(rope);
+ });
+}
+
+// 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
+
+
+/***/ }),
+/* 1049 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149733,7 +153705,7 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key,
*/
var GameObjectFactory = __webpack_require__(5);
-var Sprite = __webpack_require__(69);
+var Sprite = __webpack_require__(75);
/**
* Creates a new Sprite Game Object and adds it to the Scene.
@@ -149745,7 +153717,7 @@ var Sprite = __webpack_require__(69);
*
* @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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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.Sprite} The Game Object that was created.
@@ -149770,7 +153742,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame)
/***/ }),
-/* 1035 */
+/* 1050 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149779,7 +153751,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BitmapText = __webpack_require__(129);
+var BitmapText = __webpack_require__(134);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149834,7 +153806,7 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align
/***/ }),
-/* 1036 */
+/* 1051 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149843,7 +153815,7 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Text = __webpack_require__(195);
+var Text = __webpack_require__(204);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149880,7 +153852,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|string[])} text - The text this Text object will display.
- * @param {object} [style] - The Text style configuration object.
+ * @param {Phaser.Types.GameObjects.Text.TextStyle} [style] - The Text style configuration object.
*
* @return {Phaser.GameObjects.Text} The Game Object that was created.
*/
@@ -149899,7 +153871,7 @@ GameObjectFactory.register('text', function (x, y, text, style)
/***/ }),
-/* 1037 */
+/* 1052 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149908,7 +153880,7 @@ GameObjectFactory.register('text', function (x, y, text, style)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var TileSprite = __webpack_require__(196);
+var TileSprite = __webpack_require__(205);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149923,7 +153895,7 @@ var GameObjectFactory = __webpack_require__(5);
* @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 {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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.TileSprite} The Game Object that was created.
@@ -149943,7 +153915,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra
/***/ }),
-/* 1038 */
+/* 1053 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149952,7 +153924,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Zone = __webpack_require__(110);
+var Zone = __webpack_require__(111);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -149985,7 +153957,7 @@ GameObjectFactory.register('zone', function (x, y, width, height)
/***/ }),
-/* 1039 */
+/* 1054 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -149994,23 +153966,22 @@ GameObjectFactory.register('zone', function (x, y, width, height)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Video = __webpack_require__(197);
+var Video = __webpack_require__(206);
var GameObjectFactory = __webpack_require__(5);
/**
- * Creates a new Image Game Object and adds it to the Scene.
+ * Creates a new Video Game Object and adds it to the Scene.
*
- * Note: This method will only be available if the Image Game Object has been built into Phaser.
+ * Note: This method will only be available if the Video Game Object has been built into Phaser.
*
* @method Phaser.GameObjects.GameObjectFactory#video
* @since 3.20.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} texture - 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} [key] - Optional key of the Video this Game Object will play, as stored in the Video Cache.
*
- * @return {Phaser.GameObjects.Image} The Game Object that was created.
+ * @return {Phaser.GameObjects.Video} The Game Object that was created.
*/
GameObjectFactory.register('video', function (x, y, key)
{
@@ -150032,7 +154003,7 @@ GameObjectFactory.register('video', function (x, y, key)
/***/ }),
-/* 1040 */
+/* 1055 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150041,7 +154012,7 @@ GameObjectFactory.register('video', function (x, y, key)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Arc = __webpack_require__(402);
+var Arc = __webpack_require__(410);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -150105,7 +154076,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph
/***/ }),
-/* 1041 */
+/* 1056 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150115,7 +154086,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph
*/
var GameObjectFactory = __webpack_require__(5);
-var Curve = __webpack_require__(403);
+var Curve = __webpack_require__(411);
/**
* Creates a new Curve Shape Game Object and adds it to the Scene.
@@ -150155,7 +154126,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha)
/***/ }),
-/* 1042 */
+/* 1057 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150164,7 +154135,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Ellipse = __webpack_require__(404);
+var Ellipse = __webpack_require__(412);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -150207,7 +154178,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor,
/***/ }),
-/* 1043 */
+/* 1058 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150217,7 +154188,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor,
*/
var GameObjectFactory = __webpack_require__(5);
-var Grid = __webpack_require__(405);
+var Grid = __webpack_require__(413);
/**
* Creates a new Grid Shape Game Object and adds it to the Scene.
@@ -150262,7 +154233,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel
/***/ }),
-/* 1044 */
+/* 1059 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150272,7 +154243,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel
*/
var GameObjectFactory = __webpack_require__(5);
-var IsoBox = __webpack_require__(406);
+var IsoBox = __webpack_require__(414);
/**
* Creates a new IsoBox Shape Game Object and adds it to the Scene.
@@ -150313,7 +154284,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill
/***/ }),
-/* 1045 */
+/* 1060 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150323,7 +154294,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill
*/
var GameObjectFactory = __webpack_require__(5);
-var IsoTriangle = __webpack_require__(407);
+var IsoTriangle = __webpack_require__(415);
/**
* Creates a new IsoTriangle Shape Game Object and adds it to the Scene.
@@ -150366,7 +154337,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed
/***/ }),
-/* 1046 */
+/* 1061 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150376,7 +154347,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed
*/
var GameObjectFactory = __webpack_require__(5);
-var Line = __webpack_require__(408);
+var Line = __webpack_require__(416);
/**
* Creates a new Line Shape Game Object and adds it to the Scene.
@@ -150417,7 +154388,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor,
/***/ }),
-/* 1047 */
+/* 1062 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150427,7 +154398,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor,
*/
var GameObjectFactory = __webpack_require__(5);
-var Polygon = __webpack_require__(409);
+var Polygon = __webpack_require__(417);
/**
* Creates a new Polygon Shape Game Object and adds it to the Scene.
@@ -150470,7 +154441,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp
/***/ }),
-/* 1048 */
+/* 1063 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150480,7 +154451,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp
*/
var GameObjectFactory = __webpack_require__(5);
-var Rectangle = __webpack_require__(414);
+var Rectangle = __webpack_require__(422);
/**
* Creates a new Rectangle Shape Game Object and adds it to the Scene.
@@ -150515,7 +154486,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor
/***/ }),
-/* 1049 */
+/* 1064 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150524,7 +154495,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Star = __webpack_require__(415);
+var Star = __webpack_require__(423);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -150567,7 +154538,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad
/***/ }),
-/* 1050 */
+/* 1065 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150577,7 +154548,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad
*/
var GameObjectFactory = __webpack_require__(5);
-var Triangle = __webpack_require__(416);
+var Triangle = __webpack_require__(424);
/**
* Creates a new Triangle Shape Game Object and adds it to the Scene.
@@ -150618,7 +154589,7 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f
/***/ }),
-/* 1051 */
+/* 1066 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150627,8 +154598,8 @@ 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__(186);
-var BuildGameObject = __webpack_require__(28);
+var Blitter = __webpack_require__(194);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
@@ -150668,7 +154639,7 @@ GameObjectCreator.register('blitter', function (config, addToScene)
/***/ }),
-/* 1052 */
+/* 1067 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150678,8 +154649,8 @@ GameObjectCreator.register('blitter', function (config, addToScene)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
-var Container = __webpack_require__(187);
+var BuildGameObject = __webpack_require__(27);
+var Container = __webpack_require__(195);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
@@ -150717,7 +154688,7 @@ GameObjectCreator.register('container', function (config, addToScene)
/***/ }),
-/* 1053 */
+/* 1068 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150726,8 +154697,8 @@ GameObjectCreator.register('container', function (config, addToScene)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BitmapText = __webpack_require__(188);
-var BuildGameObject = __webpack_require__(28);
+var BitmapText = __webpack_require__(196);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
@@ -150768,7 +154739,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene)
/***/ }),
-/* 1054 */
+/* 1069 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150778,7 +154749,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene)
*/
var GameObjectCreator = __webpack_require__(16);
-var Graphics = __webpack_require__(189);
+var Graphics = __webpack_require__(197);
/**
* Creates a new Graphics Game Object and returns it.
@@ -150816,7 +154787,7 @@ GameObjectCreator.register('graphics', function (config, addToScene)
/***/ }),
-/* 1055 */
+/* 1070 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150826,7 +154797,7 @@ GameObjectCreator.register('graphics', function (config, addToScene)
*/
var GameObjectCreator = __webpack_require__(16);
-var Group = __webpack_require__(97);
+var Group = __webpack_require__(98);
/**
* Creates a new Group Game Object and returns it.
@@ -150849,7 +154820,7 @@ GameObjectCreator.register('group', function (config)
/***/ }),
-/* 1056 */
+/* 1071 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150858,10 +154829,10 @@ GameObjectCreator.register('group', function (config)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
-var Image = __webpack_require__(98);
+var Image = __webpack_require__(108);
/**
* Creates a new Image Game Object and returns it.
@@ -150899,7 +154870,7 @@ GameObjectCreator.register('image', function (config, addToScene)
/***/ }),
-/* 1057 */
+/* 1072 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150911,7 +154882,7 @@ GameObjectCreator.register('image', function (config, addToScene)
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
var GetFastValue = __webpack_require__(2);
-var ParticleEmitterManager = __webpack_require__(192);
+var ParticleEmitterManager = __webpack_require__(200);
/**
* Creates a new Particle Emitter Manager Game Object and returns it.
@@ -150956,7 +154927,7 @@ GameObjectCreator.register('particles', function (config, addToScene)
/***/ }),
-/* 1058 */
+/* 1073 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -150965,10 +154936,10 @@ GameObjectCreator.register('particles', function (config, addToScene)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
-var RenderTexture = __webpack_require__(193);
+var RenderTexture = __webpack_require__(201);
/**
* Creates a new Render Texture Game Object and returns it.
@@ -151008,7 +154979,7 @@ GameObjectCreator.register('renderTexture', function (config, addToScene)
/***/ }),
-/* 1059 */
+/* 1074 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151017,11 +154988,66 @@ GameObjectCreator.register('renderTexture', function (config, addToScene)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
-var BuildGameObjectAnimation = __webpack_require__(385);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
-var Sprite = __webpack_require__(69);
+var GetValue = __webpack_require__(6);
+var Rope = __webpack_require__(203);
+
+/**
+ * Creates a new Rope Game Object and returns it.
+ *
+ * Note: This method will only be available if the Rope Game Object and WebGL support have been built into Phaser.
+ *
+ * @method Phaser.GameObjects.GameObjectCreator#rope
+ * @since 3.23.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.Rope} The Game Object that was created.
+ */
+GameObjectCreator.register('rope', function (config, addToScene)
+{
+ if (config === undefined) { config = {}; }
+
+ var key = GetAdvancedValue(config, 'key', null);
+ var frame = GetAdvancedValue(config, 'frame', null);
+ var horizontal = GetAdvancedValue(config, 'horizontal', true);
+ var points = GetValue(config, 'points', undefined);
+ var colors = GetValue(config, 'colors', undefined);
+ var alphas = GetValue(config, 'alphas', undefined);
+
+ var rope = new Rope(this.scene, 0, 0, key, frame, points, horizontal, colors, alphas);
+
+ if (addToScene !== undefined)
+ {
+ config.add = addToScene;
+ }
+
+ BuildGameObject(this.scene, rope, config);
+
+ return rope;
+});
+
+// When registering a factory function 'this' refers to the GameObjectCreator context.
+
+
+/***/ }),
+/* 1075 */
+/***/ (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 BuildGameObjectAnimation = __webpack_require__(393);
+var GameObjectCreator = __webpack_require__(16);
+var GetAdvancedValue = __webpack_require__(15);
+var Sprite = __webpack_require__(75);
/**
* Creates a new Sprite Game Object and returns it.
@@ -151061,7 +155087,7 @@ GameObjectCreator.register('sprite', function (config, addToScene)
/***/ }),
-/* 1060 */
+/* 1076 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151070,8 +155096,8 @@ GameObjectCreator.register('sprite', function (config, addToScene)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BitmapText = __webpack_require__(129);
-var BuildGameObject = __webpack_require__(28);
+var BitmapText = __webpack_require__(134);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
var GetValue = __webpack_require__(6);
@@ -151114,7 +155140,7 @@ GameObjectCreator.register('bitmapText', function (config, addToScene)
/***/ }),
-/* 1061 */
+/* 1077 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151123,10 +155149,10 @@ GameObjectCreator.register('bitmapText', function (config, addToScene)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
-var Text = __webpack_require__(195);
+var Text = __webpack_require__(204);
/**
* Creates a new Text Game Object and returns it.
@@ -151136,7 +155162,7 @@ var Text = __webpack_require__(195);
* @method Phaser.GameObjects.GameObjectCreator#text
* @since 3.0.0
*
- * @param {object} config - The configuration object this Game Object will use to create itself.
+ * @param {Phaser.Types.GameObjects.Text.TextConfig} 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.Text} The Game Object that was created.
@@ -151201,7 +155227,7 @@ GameObjectCreator.register('text', function (config, addToScene)
/***/ }),
-/* 1062 */
+/* 1078 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151210,10 +155236,10 @@ GameObjectCreator.register('text', function (config, addToScene)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
-var TileSprite = __webpack_require__(196);
+var TileSprite = __webpack_require__(205);
/**
* Creates a new TileSprite Game Object and returns it.
@@ -151253,7 +155279,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene)
/***/ }),
-/* 1063 */
+/* 1079 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151264,7 +155290,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene)
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
-var Zone = __webpack_require__(110);
+var Zone = __webpack_require__(111);
/**
* Creates a new Zone Game Object and returns it.
@@ -151292,7 +155318,7 @@ GameObjectCreator.register('zone', function (config)
/***/ }),
-/* 1064 */
+/* 1080 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151301,10 +155327,10 @@ GameObjectCreator.register('zone', function (config)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
-var Video = __webpack_require__(197);
+var Video = __webpack_require__(206);
/**
* Creates a new Video Game Object and returns it.
@@ -151341,7 +155367,7 @@ GameObjectCreator.register('video', function (config, addToScene)
/***/ }),
-/* 1065 */
+/* 1081 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151355,12 +155381,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1066);
+ renderWebGL = __webpack_require__(1082);
}
if (true)
{
- renderCanvas = __webpack_require__(1067);
+ renderCanvas = __webpack_require__(1083);
}
module.exports = {
@@ -151372,7 +155398,7 @@ module.exports = {
/***/ }),
-/* 1066 */
+/* 1082 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151433,9 +155459,6 @@ var MeshWebGLRenderer = function (renderer, src, interpolationPercentage, camera
camMatrix.multiply(spriteMatrix, calcMatrix);
}
- var frame = src.frame;
- var texture = frame.glTexture;
-
var vertices = src.vertices;
var uvs = src.uv;
var colors = src.colors;
@@ -151449,7 +155472,7 @@ var MeshWebGLRenderer = function (renderer, src, interpolationPercentage, camera
pipeline.flush();
}
- pipeline.setTexture2D(texture, 0);
+ var textureUnit = pipeline.setGameObject(src);
var vertexViewF32 = pipeline.vertexViewF32;
var vertexViewU32 = pipeline.vertexViewU32;
@@ -151477,6 +155500,7 @@ var MeshWebGLRenderer = function (renderer, src, interpolationPercentage, camera
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]);
@@ -151490,7 +155514,7 @@ module.exports = MeshWebGLRenderer;
/***/ }),
-/* 1067 */
+/* 1083 */
/***/ (function(module, exports) {
/**
@@ -151519,7 +155543,7 @@ module.exports = MeshCanvasRenderer;
/***/ }),
-/* 1068 */
+/* 1084 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151533,12 +155557,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1069);
+ renderWebGL = __webpack_require__(1085);
}
if (true)
{
- renderCanvas = __webpack_require__(1070);
+ renderCanvas = __webpack_require__(1086);
}
module.exports = {
@@ -151550,7 +155574,7 @@ module.exports = {
/***/ }),
-/* 1069 */
+/* 1085 */
/***/ (function(module, exports) {
/**
@@ -151634,7 +155658,7 @@ module.exports = ShaderWebGLRenderer;
/***/ }),
-/* 1070 */
+/* 1086 */
/***/ (function(module, exports) {
/**
@@ -151663,7 +155687,7 @@ module.exports = ShaderCanvasRenderer;
/***/ }),
-/* 1071 */
+/* 1087 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151672,7 +155696,7 @@ module.exports = ShaderCanvasRenderer;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Mesh = __webpack_require__(130);
+var Mesh = __webpack_require__(136);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -151690,7 +155714,7 @@ var GameObjectFactory = __webpack_require__(5);
* @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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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.
@@ -151713,7 +155737,7 @@ if (true)
/***/ }),
-/* 1072 */
+/* 1088 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151722,7 +155746,7 @@ if (true)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Quad = __webpack_require__(200);
+var Quad = __webpack_require__(209);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -151736,9 +155760,9 @@ 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} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
+ * @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 (true)
@@ -151750,16 +155774,16 @@ 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
/***/ }),
-/* 1073 */
+/* 1089 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151768,7 +155792,7 @@ if (true)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Shader = __webpack_require__(201);
+var Shader = __webpack_require__(210);
var GameObjectFactory = __webpack_require__(5);
/**
@@ -151800,7 +155824,7 @@ if (true)
/***/ }),
-/* 1074 */
+/* 1090 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151809,11 +155833,11 @@ if (true)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
var GetValue = __webpack_require__(6);
-var Mesh = __webpack_require__(130);
+var Mesh = __webpack_require__(136);
/**
* Creates a new Mesh Game Object and returns it.
@@ -151855,7 +155879,7 @@ GameObjectCreator.register('mesh', function (config, addToScene)
/***/ }),
-/* 1075 */
+/* 1091 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151864,10 +155888,10 @@ GameObjectCreator.register('mesh', function (config, addToScene)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
-var Quad = __webpack_require__(200);
+var Quad = __webpack_require__(209);
/**
* Creates a new Quad Game Object and returns it.
@@ -151905,7 +155929,7 @@ GameObjectCreator.register('quad', function (config, addToScene)
/***/ }),
-/* 1076 */
+/* 1092 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151914,10 +155938,10 @@ GameObjectCreator.register('quad', function (config, addToScene)
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var BuildGameObject = __webpack_require__(28);
+var BuildGameObject = __webpack_require__(27);
var GameObjectCreator = __webpack_require__(16);
var GetAdvancedValue = __webpack_require__(15);
-var Shader = __webpack_require__(201);
+var Shader = __webpack_require__(210);
/**
* Creates a new Shader Game Object and returns it.
@@ -151958,7 +155982,7 @@ GameObjectCreator.register('shader', function (config, addToScene)
/***/ }),
-/* 1077 */
+/* 1093 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -151968,9 +155992,9 @@ GameObjectCreator.register('shader', function (config, addToScene)
*/
var Class = __webpack_require__(0);
-var LightsManager = __webpack_require__(421);
+var LightsManager = __webpack_require__(429);
var PluginCache = __webpack_require__(23);
-var SceneEvents = __webpack_require__(19);
+var SceneEvents = __webpack_require__(22);
/**
* @classdesc
@@ -152074,7 +156098,7 @@ module.exports = LightsPlugin;
/***/ }),
-/* 1078 */
+/* 1094 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152085,27 +156109,27 @@ module.exports = LightsPlugin;
var Circle = __webpack_require__(65);
-Circle.Area = __webpack_require__(1079);
-Circle.Circumference = __webpack_require__(265);
-Circle.CircumferencePoint = __webpack_require__(146);
-Circle.Clone = __webpack_require__(1080);
-Circle.Contains = __webpack_require__(55);
-Circle.ContainsPoint = __webpack_require__(1081);
-Circle.ContainsRect = __webpack_require__(1082);
-Circle.CopyFrom = __webpack_require__(1083);
-Circle.Equals = __webpack_require__(1084);
-Circle.GetBounds = __webpack_require__(1085);
-Circle.GetPoint = __webpack_require__(263);
-Circle.GetPoints = __webpack_require__(264);
-Circle.Offset = __webpack_require__(1086);
-Circle.OffsetPoint = __webpack_require__(1087);
-Circle.Random = __webpack_require__(147);
+Circle.Area = __webpack_require__(1095);
+Circle.Circumference = __webpack_require__(272);
+Circle.CircumferencePoint = __webpack_require__(153);
+Circle.Clone = __webpack_require__(1096);
+Circle.Contains = __webpack_require__(56);
+Circle.ContainsPoint = __webpack_require__(1097);
+Circle.ContainsRect = __webpack_require__(1098);
+Circle.CopyFrom = __webpack_require__(1099);
+Circle.Equals = __webpack_require__(1100);
+Circle.GetBounds = __webpack_require__(1101);
+Circle.GetPoint = __webpack_require__(270);
+Circle.GetPoints = __webpack_require__(271);
+Circle.Offset = __webpack_require__(1102);
+Circle.OffsetPoint = __webpack_require__(1103);
+Circle.Random = __webpack_require__(154);
module.exports = Circle;
/***/ }),
-/* 1079 */
+/* 1095 */
/***/ (function(module, exports) {
/**
@@ -152133,7 +156157,7 @@ module.exports = Area;
/***/ }),
-/* 1080 */
+/* 1096 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152163,7 +156187,7 @@ module.exports = Clone;
/***/ }),
-/* 1081 */
+/* 1097 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152172,7 +156196,7 @@ module.exports = Clone;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Contains = __webpack_require__(55);
+var Contains = __webpack_require__(56);
/**
* Check to see if the Circle contains the given Point object.
@@ -152194,7 +156218,7 @@ module.exports = ContainsPoint;
/***/ }),
-/* 1082 */
+/* 1098 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152203,7 +156227,7 @@ module.exports = ContainsPoint;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Contains = __webpack_require__(55);
+var Contains = __webpack_require__(56);
/**
* Check to see if the Circle contains all four points of the given Rectangle object.
@@ -152230,7 +156254,7 @@ module.exports = ContainsRect;
/***/ }),
-/* 1083 */
+/* 1099 */
/***/ (function(module, exports) {
/**
@@ -152262,7 +156286,7 @@ module.exports = CopyFrom;
/***/ }),
-/* 1084 */
+/* 1100 */
/***/ (function(module, exports) {
/**
@@ -152296,7 +156320,7 @@ module.exports = Equals;
/***/ }),
-/* 1085 */
+/* 1101 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152305,7 +156329,7 @@ module.exports = Equals;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Rectangle = __webpack_require__(11);
+var Rectangle = __webpack_require__(9);
/**
* Returns the bounds of the Circle object.
@@ -152336,7 +156360,7 @@ module.exports = GetBounds;
/***/ }),
-/* 1086 */
+/* 1102 */
/***/ (function(module, exports) {
/**
@@ -152371,7 +156395,7 @@ module.exports = Offset;
/***/ }),
-/* 1087 */
+/* 1103 */
/***/ (function(module, exports) {
/**
@@ -152405,7 +156429,7 @@ module.exports = OffsetPoint;
/***/ }),
-/* 1088 */
+/* 1104 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152414,29 +156438,29 @@ module.exports = OffsetPoint;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Ellipse = __webpack_require__(95);
+var Ellipse = __webpack_require__(96);
-Ellipse.Area = __webpack_require__(1089);
-Ellipse.Circumference = __webpack_require__(392);
-Ellipse.CircumferencePoint = __webpack_require__(191);
-Ellipse.Clone = __webpack_require__(1090);
-Ellipse.Contains = __webpack_require__(96);
-Ellipse.ContainsPoint = __webpack_require__(1091);
-Ellipse.ContainsRect = __webpack_require__(1092);
-Ellipse.CopyFrom = __webpack_require__(1093);
-Ellipse.Equals = __webpack_require__(1094);
-Ellipse.GetBounds = __webpack_require__(1095);
-Ellipse.GetPoint = __webpack_require__(390);
-Ellipse.GetPoints = __webpack_require__(391);
-Ellipse.Offset = __webpack_require__(1096);
-Ellipse.OffsetPoint = __webpack_require__(1097);
-Ellipse.Random = __webpack_require__(154);
+Ellipse.Area = __webpack_require__(1105);
+Ellipse.Circumference = __webpack_require__(400);
+Ellipse.CircumferencePoint = __webpack_require__(199);
+Ellipse.Clone = __webpack_require__(1106);
+Ellipse.Contains = __webpack_require__(97);
+Ellipse.ContainsPoint = __webpack_require__(1107);
+Ellipse.ContainsRect = __webpack_require__(1108);
+Ellipse.CopyFrom = __webpack_require__(1109);
+Ellipse.Equals = __webpack_require__(1110);
+Ellipse.GetBounds = __webpack_require__(1111);
+Ellipse.GetPoint = __webpack_require__(398);
+Ellipse.GetPoints = __webpack_require__(399);
+Ellipse.Offset = __webpack_require__(1112);
+Ellipse.OffsetPoint = __webpack_require__(1113);
+Ellipse.Random = __webpack_require__(162);
module.exports = Ellipse;
/***/ }),
-/* 1089 */
+/* 1105 */
/***/ (function(module, exports) {
/**
@@ -152470,7 +156494,7 @@ module.exports = Area;
/***/ }),
-/* 1090 */
+/* 1106 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152479,7 +156503,7 @@ module.exports = Area;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Ellipse = __webpack_require__(95);
+var Ellipse = __webpack_require__(96);
/**
* Creates a new Ellipse instance based on the values contained in the given source.
@@ -152500,7 +156524,7 @@ module.exports = Clone;
/***/ }),
-/* 1091 */
+/* 1107 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152509,7 +156533,7 @@ module.exports = Clone;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Contains = __webpack_require__(96);
+var Contains = __webpack_require__(97);
/**
* Check to see if the Ellipse contains the given Point object.
@@ -152531,7 +156555,7 @@ module.exports = ContainsPoint;
/***/ }),
-/* 1092 */
+/* 1108 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152540,7 +156564,7 @@ module.exports = ContainsPoint;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Contains = __webpack_require__(96);
+var Contains = __webpack_require__(97);
/**
* Check to see if the Ellipse contains all four points of the given Rectangle object.
@@ -152567,7 +156591,7 @@ module.exports = ContainsRect;
/***/ }),
-/* 1093 */
+/* 1109 */
/***/ (function(module, exports) {
/**
@@ -152599,7 +156623,7 @@ module.exports = CopyFrom;
/***/ }),
-/* 1094 */
+/* 1110 */
/***/ (function(module, exports) {
/**
@@ -152634,7 +156658,7 @@ module.exports = Equals;
/***/ }),
-/* 1095 */
+/* 1111 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152643,7 +156667,7 @@ module.exports = Equals;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Rectangle = __webpack_require__(11);
+var Rectangle = __webpack_require__(9);
/**
* Returns the bounds of the Ellipse object.
@@ -152674,7 +156698,7 @@ module.exports = GetBounds;
/***/ }),
-/* 1096 */
+/* 1112 */
/***/ (function(module, exports) {
/**
@@ -152709,7 +156733,7 @@ module.exports = Offset;
/***/ }),
-/* 1097 */
+/* 1113 */
/***/ (function(module, exports) {
/**
@@ -152743,7 +156767,7 @@ module.exports = OffsetPoint;
/***/ }),
-/* 1098 */
+/* 1114 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152754,7 +156778,7 @@ module.exports = OffsetPoint;
*/
var Point = __webpack_require__(4);
-var CircleToCircle = __webpack_require__(202);
+var CircleToCircle = __webpack_require__(211);
/**
* Checks if two Circles intersect and returns the intersection points as a Point object array.
@@ -152837,7 +156861,7 @@ module.exports = GetCircleToCircle;
/***/ }),
-/* 1099 */
+/* 1115 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152847,8 +156871,8 @@ module.exports = GetCircleToCircle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetLineToCircle = __webpack_require__(204);
-var CircleToRectangle = __webpack_require__(203);
+var GetLineToCircle = __webpack_require__(213);
+var CircleToRectangle = __webpack_require__(212);
/**
* Checks for intersection between a circle and a rectangle,
@@ -152887,7 +156911,100 @@ module.exports = GetCircleToRectangle;
/***/ }),
-/* 1100 */
+/* 1116 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+var Vector3 = __webpack_require__(94);
+var Vector4 = __webpack_require__(179);
+var GetLineToLine = __webpack_require__(432);
+var Line = __webpack_require__(49);
+
+// Temp calculation segment
+var segment = new Line();
+
+// Temp vec3
+var tempIntersect = new 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.
+ *
+ * @function Phaser.Geom.Intersects.GetLineToPolygon
+ * @since 3.50.0
+ *
+ * @param {Phaser.Geom.Line} line - The line segment to check.
+ * @param {Phaser.Geom.Polygon | Phaser.Geom.Polygon[]} polygons - A single polygon, or array of polygons, to check.
+ * @param {Phaser.Math.Vector4} [out] - A Vector4 to store the intersection results in.
+ *
+ * @return {Phaser.Math.Vector4} A Vector4 containing the intersection results, or `null`.
+ */
+var GetLineToPolygon = function (line, polygons, out)
+{
+ if (out === undefined)
+ {
+ out = new Vector4();
+ }
+
+ if (!Array.isArray(polygons))
+ {
+ polygons = [ polygons ];
+ }
+
+ var closestIntersect = false;
+
+ // Reset our temporary vec4
+ tempIntersect.set();
+
+ for (var p = 0; p < polygons.length; p++)
+ {
+ var points = polygons[p].points;
+
+ var prev = points[0];
+
+ for (var i = 1; i < points.length; i++)
+ {
+ var current = points[i];
+
+ segment.setTo(prev.x, prev.y, current.x, current.y);
+
+ prev = current;
+
+ if (!GetLineToLine(line, segment, tempIntersect))
+ {
+ // No intersection? Carry on ...
+ continue;
+ }
+
+ if (!closestIntersect || tempIntersect.z < out.z)
+ {
+ out.set(tempIntersect.x, tempIntersect.y, tempIntersect.z, p);
+
+ closestIntersect = true;
+ }
+ }
+ }
+
+ return (closestIntersect) ? out : null;
+};
+
+module.exports = GetLineToPolygon;
+
+
+/***/ }),
+/* 1117 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152896,8 +157013,8 @@ module.exports = GetCircleToRectangle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Rectangle = __webpack_require__(11);
-var RectangleToRectangle = __webpack_require__(131);
+var Rectangle = __webpack_require__(9);
+var RectangleToRectangle = __webpack_require__(137);
/**
* Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object.
@@ -152936,7 +157053,7 @@ module.exports = GetRectangleIntersection;
/***/ }),
-/* 1101 */
+/* 1118 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152946,8 +157063,8 @@ module.exports = GetRectangleIntersection;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetLineToRectangle = __webpack_require__(206);
-var RectangleToRectangle = __webpack_require__(131);
+var GetLineToRectangle = __webpack_require__(215);
+var RectangleToRectangle = __webpack_require__(137);
/**
* Checks if two Rectangles intersect and returns the intersection points as a Point object array.
@@ -152987,7 +157104,7 @@ module.exports = GetRectangleToRectangle;
/***/ }),
-/* 1102 */
+/* 1119 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -152997,8 +157114,8 @@ module.exports = GetRectangleToRectangle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RectangleToTriangle = __webpack_require__(425);
-var GetLineToRectangle = __webpack_require__(206);
+var RectangleToTriangle = __webpack_require__(434);
+var GetLineToRectangle = __webpack_require__(215);
/**
* Checks for intersection between Rectangle shape and Triangle shape,
@@ -153035,7 +157152,7 @@ module.exports = GetRectangleToTriangle;
/***/ }),
-/* 1103 */
+/* 1120 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153045,8 +157162,8 @@ module.exports = GetRectangleToTriangle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetLineToCircle = __webpack_require__(204);
-var TriangleToCircle = __webpack_require__(427);
+var GetLineToCircle = __webpack_require__(213);
+var TriangleToCircle = __webpack_require__(436);
/**
* Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array.
@@ -153084,7 +157201,7 @@ module.exports = GetTriangleToCircle;
/***/ }),
-/* 1104 */
+/* 1121 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153094,8 +157211,8 @@ module.exports = GetTriangleToCircle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var TriangleToTriangle = __webpack_require__(430);
-var GetTriangleToLine = __webpack_require__(428);
+var TriangleToTriangle = __webpack_require__(439);
+var GetTriangleToLine = __webpack_require__(437);
/**
* Checks if two Triangles intersect, and returns the intersection points as a Point object array.
@@ -153133,7 +157250,7 @@ module.exports = GetTriangleToTriangle;
/***/ }),
-/* 1105 */
+/* 1122 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153142,7 +157259,7 @@ module.exports = GetTriangleToTriangle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PointToLine = __webpack_require__(432);
+var PointToLine = __webpack_require__(441);
/**
* Checks if a Point is located on the given line segment.
@@ -153174,7 +157291,7 @@ module.exports = PointToLineSegment;
/***/ }),
-/* 1106 */
+/* 1123 */
/***/ (function(module, exports) {
/**
@@ -153214,7 +157331,7 @@ module.exports = RectangleToValues;
/***/ }),
-/* 1107 */
+/* 1124 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153223,42 +157340,43 @@ module.exports = RectangleToValues;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Line = __webpack_require__(56);
+var Line = __webpack_require__(49);
Line.Angle = __webpack_require__(85);
-Line.BresenhamPoints = __webpack_require__(285);
-Line.CenterOn = __webpack_require__(1108);
-Line.Clone = __webpack_require__(1109);
-Line.CopyFrom = __webpack_require__(1110);
-Line.Equals = __webpack_require__(1111);
-Line.Extend = __webpack_require__(1112);
-Line.GetMidPoint = __webpack_require__(1113);
-Line.GetNearestPoint = __webpack_require__(1114);
-Line.GetNormal = __webpack_require__(1115);
-Line.GetPoint = __webpack_require__(272);
-Line.GetPoints = __webpack_require__(150);
-Line.GetShortestDistance = __webpack_require__(1116);
-Line.Height = __webpack_require__(1117);
+Line.BresenhamPoints = __webpack_require__(292);
+Line.CenterOn = __webpack_require__(1125);
+Line.Clone = __webpack_require__(1126);
+Line.CopyFrom = __webpack_require__(1127);
+Line.Equals = __webpack_require__(1128);
+Line.Extend = __webpack_require__(1129);
+Line.GetEasedPoints = __webpack_require__(1130);
+Line.GetMidPoint = __webpack_require__(1131);
+Line.GetNearestPoint = __webpack_require__(1132);
+Line.GetNormal = __webpack_require__(1133);
+Line.GetPoint = __webpack_require__(279);
+Line.GetPoints = __webpack_require__(157);
+Line.GetShortestDistance = __webpack_require__(1134);
+Line.Height = __webpack_require__(1135);
Line.Length = __webpack_require__(57);
-Line.NormalAngle = __webpack_require__(433);
-Line.NormalX = __webpack_require__(1118);
-Line.NormalY = __webpack_require__(1119);
-Line.Offset = __webpack_require__(1120);
-Line.PerpSlope = __webpack_require__(1121);
-Line.Random = __webpack_require__(151);
-Line.ReflectAngle = __webpack_require__(1122);
-Line.Rotate = __webpack_require__(1123);
-Line.RotateAroundPoint = __webpack_require__(1124);
-Line.RotateAroundXY = __webpack_require__(208);
-Line.SetToAngle = __webpack_require__(1125);
-Line.Slope = __webpack_require__(1126);
-Line.Width = __webpack_require__(1127);
+Line.NormalAngle = __webpack_require__(442);
+Line.NormalX = __webpack_require__(1136);
+Line.NormalY = __webpack_require__(1137);
+Line.Offset = __webpack_require__(1138);
+Line.PerpSlope = __webpack_require__(1139);
+Line.Random = __webpack_require__(158);
+Line.ReflectAngle = __webpack_require__(1140);
+Line.Rotate = __webpack_require__(1141);
+Line.RotateAroundPoint = __webpack_require__(1142);
+Line.RotateAroundXY = __webpack_require__(217);
+Line.SetToAngle = __webpack_require__(1143);
+Line.Slope = __webpack_require__(1144);
+Line.Width = __webpack_require__(1145);
module.exports = Line;
/***/ }),
-/* 1108 */
+/* 1125 */
/***/ (function(module, exports) {
/**
@@ -153298,7 +157416,7 @@ module.exports = CenterOn;
/***/ }),
-/* 1109 */
+/* 1126 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153307,7 +157425,7 @@ module.exports = CenterOn;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Line = __webpack_require__(56);
+var Line = __webpack_require__(49);
/**
* Clone the given line.
@@ -153328,7 +157446,7 @@ module.exports = Clone;
/***/ }),
-/* 1110 */
+/* 1127 */
/***/ (function(module, exports) {
/**
@@ -153359,7 +157477,7 @@ module.exports = CopyFrom;
/***/ }),
-/* 1111 */
+/* 1128 */
/***/ (function(module, exports) {
/**
@@ -153393,7 +157511,7 @@ module.exports = Equals;
/***/ }),
-/* 1112 */
+/* 1129 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153451,7 +157569,127 @@ module.exports = Extend;
/***/ }),
-/* 1113 */
+/* 1130 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+var DistanceBetweenPoints = __webpack_require__(324);
+var GetEaseFunction = __webpack_require__(69);
+var Point = __webpack_require__(4);
+
+/**
+ * Returns an array of `quantity` Points where each point is taken from the given Line,
+ * spaced out according to the ease function specified.
+ *
+ * ```javascript
+ * const line = new Phaser.Geom.Line(100, 300, 700, 300);
+ * const points = Phaser.Geom.Line.GetEasedPoints(line, 'sine.out', 32)
+ * ```
+ *
+ * In the above example, the `points` array will contain 32 points spread-out across
+ * the length of `line`, where the position of each point is determined by the `Sine.out`
+ * ease function.
+ *
+ * You can optionally provide a collinear threshold. In this case, the resulting points
+ * are checked against each other, and if they are `< collinearThreshold` distance apart,
+ * they are dropped from the results. This can help avoid lots of clustered points at
+ * far ends of the line with tightly-packed eases such as Quartic. Leave the value set
+ * to zero to skip this check.
+ *
+ * Note that if you provide a collinear threshold, the resulting array may not always
+ * contain `quantity` points.
+ *
+ * @function Phaser.Geom.Line.GetEasedPoints
+ * @since 3.23.0
+ *
+ * @generic {Phaser.Geom.Point[]} O - [out,$return]
+ *
+ * @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} [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.
+ *
+ * @return {Phaser.Geom.Point[]} An array of Geom.Points containing the coordinates of the points on the line.
+ */
+var GetEasedPoints = function (line, ease, quantity, collinearThreshold, easeParams)
+{
+ if (collinearThreshold === undefined) { collinearThreshold = 0; }
+ if (easeParams === undefined) { easeParams = []; }
+
+ var results = [];
+
+ var x1 = line.x1;
+ var y1 = line.y1;
+
+ var spaceX = line.x2 - x1;
+ var spaceY = line.y2 - y1;
+
+ var easeFunc = GetEaseFunction(ease, easeParams);
+
+ var i;
+ var v;
+ var q = quantity - 1;
+
+ for (i = 0; i < q; i++)
+ {
+ v = easeFunc(i / q);
+
+ results.push(new Point(x1 + (spaceX * v), y1 + (spaceY * v)));
+ }
+
+ // Always include the end of the line
+ v = easeFunc(1);
+
+ results.push(new Point(x1 + (spaceX * v), y1 + (spaceY * v)));
+
+ // Remove collinear parts
+ if (collinearThreshold > 0)
+ {
+ var prevPoint = results[0];
+
+ // Store the new results here
+ var sortedResults = [ prevPoint ];
+
+ for (i = 1; i < results.length - 1; i++)
+ {
+ var point = results[i];
+
+ if (DistanceBetweenPoints(prevPoint, point) >= collinearThreshold)
+ {
+ sortedResults.push(point);
+ prevPoint = point;
+ }
+ }
+
+ // Top and tail
+ var endPoint = results[results.length - 1];
+
+ if (DistanceBetweenPoints(prevPoint, endPoint) < collinearThreshold)
+ {
+ sortedResults.pop();
+ }
+
+ sortedResults.push(endPoint);
+
+ return sortedResults;
+ }
+ else
+ {
+ return results;
+ }
+};
+
+module.exports = GetEasedPoints;
+
+
+/***/ }),
+/* 1131 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153489,7 +157727,7 @@ module.exports = GetMidPoint;
/***/ }),
-/* 1114 */
+/* 1132 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153544,7 +157782,7 @@ module.exports = GetNearestPoint;
/***/ }),
-/* 1115 */
+/* 1133 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153588,7 +157826,7 @@ module.exports = GetNormal;
/***/ }),
-/* 1116 */
+/* 1134 */
/***/ (function(module, exports) {
/**
@@ -153635,7 +157873,7 @@ module.exports = GetShortestDistance;
/***/ }),
-/* 1117 */
+/* 1135 */
/***/ (function(module, exports) {
/**
@@ -153663,7 +157901,7 @@ module.exports = Height;
/***/ }),
-/* 1118 */
+/* 1136 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153676,14 +157914,14 @@ var MATH_CONST = __webpack_require__(13);
var Angle = __webpack_require__(85);
/**
- * [description]
+ * Returns the x component of the normal vector of the given line.
*
* @function Phaser.Geom.Line.NormalX
* @since 3.0.0
*
* @param {Phaser.Geom.Line} line - The Line object to get the normal value from.
*
- * @return {number} [description]
+ * @return {number} The x component of the normal vector of the line.
*/
var NormalX = function (line)
{
@@ -153694,7 +157932,7 @@ module.exports = NormalX;
/***/ }),
-/* 1119 */
+/* 1137 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153726,7 +157964,7 @@ module.exports = NormalY;
/***/ }),
-/* 1120 */
+/* 1138 */
/***/ (function(module, exports) {
/**
@@ -153764,7 +158002,7 @@ module.exports = Offset;
/***/ }),
-/* 1121 */
+/* 1139 */
/***/ (function(module, exports) {
/**
@@ -153792,7 +158030,7 @@ module.exports = PerpSlope;
/***/ }),
-/* 1122 */
+/* 1140 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153802,7 +158040,7 @@ module.exports = PerpSlope;
*/
var Angle = __webpack_require__(85);
-var NormalAngle = __webpack_require__(433);
+var NormalAngle = __webpack_require__(442);
/**
* Calculate the reflected angle between two lines.
@@ -153826,7 +158064,7 @@ module.exports = ReflectAngle;
/***/ }),
-/* 1123 */
+/* 1141 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153835,7 +158073,7 @@ module.exports = ReflectAngle;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RotateAroundXY = __webpack_require__(208);
+var RotateAroundXY = __webpack_require__(217);
/**
* Rotate a line around its midpoint by the given angle in radians.
@@ -153862,7 +158100,7 @@ module.exports = Rotate;
/***/ }),
-/* 1124 */
+/* 1142 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -153871,7 +158109,7 @@ module.exports = Rotate;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RotateAroundXY = __webpack_require__(208);
+var RotateAroundXY = __webpack_require__(217);
/**
* Rotate a line around a point by the given angle in radians.
@@ -153896,7 +158134,7 @@ module.exports = RotateAroundPoint;
/***/ }),
-/* 1125 */
+/* 1143 */
/***/ (function(module, exports) {
/**
@@ -153936,7 +158174,7 @@ module.exports = SetToAngle;
/***/ }),
-/* 1126 */
+/* 1144 */
/***/ (function(module, exports) {
/**
@@ -153964,7 +158202,7 @@ module.exports = Slope;
/***/ }),
-/* 1127 */
+/* 1145 */
/***/ (function(module, exports) {
/**
@@ -153992,7 +158230,7 @@ module.exports = Width;
/***/ }),
-/* 1128 */
+/* 1146 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154003,27 +158241,27 @@ module.exports = Width;
var Point = __webpack_require__(4);
-Point.Ceil = __webpack_require__(1129);
-Point.Clone = __webpack_require__(1130);
-Point.CopyFrom = __webpack_require__(1131);
-Point.Equals = __webpack_require__(1132);
-Point.Floor = __webpack_require__(1133);
-Point.GetCentroid = __webpack_require__(1134);
-Point.GetMagnitude = __webpack_require__(434);
-Point.GetMagnitudeSq = __webpack_require__(435);
-Point.GetRectangleFromPoints = __webpack_require__(1135);
-Point.Interpolate = __webpack_require__(1136);
-Point.Invert = __webpack_require__(1137);
-Point.Negative = __webpack_require__(1138);
-Point.Project = __webpack_require__(1139);
-Point.ProjectUnit = __webpack_require__(1140);
-Point.SetMagnitude = __webpack_require__(1141);
+Point.Ceil = __webpack_require__(1147);
+Point.Clone = __webpack_require__(1148);
+Point.CopyFrom = __webpack_require__(1149);
+Point.Equals = __webpack_require__(1150);
+Point.Floor = __webpack_require__(1151);
+Point.GetCentroid = __webpack_require__(1152);
+Point.GetMagnitude = __webpack_require__(443);
+Point.GetMagnitudeSq = __webpack_require__(444);
+Point.GetRectangleFromPoints = __webpack_require__(1153);
+Point.Interpolate = __webpack_require__(1154);
+Point.Invert = __webpack_require__(1155);
+Point.Negative = __webpack_require__(1156);
+Point.Project = __webpack_require__(1157);
+Point.ProjectUnit = __webpack_require__(1158);
+Point.SetMagnitude = __webpack_require__(1159);
module.exports = Point;
/***/ }),
-/* 1129 */
+/* 1147 */
/***/ (function(module, exports) {
/**
@@ -154053,7 +158291,7 @@ module.exports = Ceil;
/***/ }),
-/* 1130 */
+/* 1148 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154083,7 +158321,7 @@ module.exports = Clone;
/***/ }),
-/* 1131 */
+/* 1149 */
/***/ (function(module, exports) {
/**
@@ -154114,7 +158352,7 @@ module.exports = CopyFrom;
/***/ }),
-/* 1132 */
+/* 1150 */
/***/ (function(module, exports) {
/**
@@ -154143,7 +158381,7 @@ module.exports = Equals;
/***/ }),
-/* 1133 */
+/* 1151 */
/***/ (function(module, exports) {
/**
@@ -154173,7 +158411,7 @@ module.exports = Floor;
/***/ }),
-/* 1134 */
+/* 1152 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154193,10 +158431,10 @@ var Point = __webpack_require__(4);
*
* @generic {Phaser.Geom.Point} O - [out,$return]
*
- * @param {Phaser.Geom.Point[]} points - [description]
- * @param {Phaser.Geom.Point} [out] - [description]
+ * @param {Phaser.Types.Math.Vector2Like[]} points - An array of Vector2Like objects to get the geometric center of.
+ * @param {Phaser.Geom.Point} [out] - A Point object to store the output coordinates in. If not given, a new Point instance is created.
*
- * @return {Phaser.Geom.Point} [description]
+ * @return {Phaser.Geom.Point} A Point object representing the geometric center of the given points.
*/
var GetCentroid = function (points, out)
{
@@ -154237,7 +158475,7 @@ module.exports = GetCentroid;
/***/ }),
-/* 1135 */
+/* 1153 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154246,7 +158484,7 @@ module.exports = GetCentroid;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Rectangle = __webpack_require__(11);
+var Rectangle = __webpack_require__(9);
/**
* Calculates the Axis Aligned Bounding Box (or aabb) from an array of points.
@@ -154256,10 +158494,10 @@ var Rectangle = __webpack_require__(11);
*
* @generic {Phaser.Geom.Rectangle} O - [out,$return]
*
- * @param {Phaser.Geom.Point[]} points - [description]
- * @param {Phaser.Geom.Rectangle} [out] - [description]
+ * @param {Phaser.Types.Math.Vector2Like[]} points - An array of Vector2Like objects to get the AABB from.
+ * @param {Phaser.Geom.Rectangle} [out] - A Rectangle object to store the results in. If not given, a new Rectangle instance is created.
*
- * @return {Phaser.Geom.Rectangle} [description]
+ * @return {Phaser.Geom.Rectangle} A Rectangle object holding the AABB values for the given points.
*/
var GetRectangleFromPoints = function (points, out)
{
@@ -154307,7 +158545,7 @@ module.exports = GetRectangleFromPoints;
/***/ }),
-/* 1136 */
+/* 1154 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154319,7 +158557,7 @@ module.exports = GetRectangleFromPoints;
var Point = __webpack_require__(4);
/**
- * [description]
+ * Returns the linear interpolation point between the two given points, based on `t`.
*
* @function Phaser.Geom.Point.Interpolate
* @since 3.0.0
@@ -154348,7 +158586,7 @@ module.exports = Interpolate;
/***/ }),
-/* 1137 */
+/* 1155 */
/***/ (function(module, exports) {
/**
@@ -154378,7 +158616,7 @@ module.exports = Invert;
/***/ }),
-/* 1138 */
+/* 1156 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154413,7 +158651,7 @@ module.exports = Negative;
/***/ }),
-/* 1139 */
+/* 1157 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154423,21 +158661,22 @@ module.exports = Negative;
*/
var Point = __webpack_require__(4);
-var GetMagnitudeSq = __webpack_require__(435);
+var GetMagnitudeSq = __webpack_require__(444);
/**
- * [description]
+ * Calculates the vector projection of `pointA` onto the nonzero `pointB`. This is the
+ * orthogonal projection of `pointA` onto a straight line paralle to `pointB`.
*
* @function Phaser.Geom.Point.Project
* @since 3.0.0
*
* @generic {Phaser.Geom.Point} O - [out,$return]
*
- * @param {Phaser.Geom.Point} pointA - [description]
- * @param {Phaser.Geom.Point} pointB - [description]
- * @param {Phaser.Geom.Point} [out] - [description]
+ * @param {Phaser.Geom.Point} pointA - Point A, to be projected onto Point B.
+ * @param {Phaser.Geom.Point} pointB - Point B, to have Point A projected upon it.
+ * @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} [description]
+ * @return {Phaser.Geom.Point} A Point object holding the coordinates of the vector projection of `pointA` onto `pointB`.
*/
var Project = function (pointA, pointB, out)
{
@@ -154459,7 +158698,7 @@ module.exports = Project;
/***/ }),
-/* 1140 */
+/* 1158 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154471,18 +158710,19 @@ module.exports = Project;
var Point = __webpack_require__(4);
/**
- * [description]
+ * Calculates the vector projection of `pointA` onto the nonzero `pointB`. This is the
+ * orthogonal projection of `pointA` onto a straight line paralle to `pointB`.
*
* @function Phaser.Geom.Point.ProjectUnit
* @since 3.0.0
*
* @generic {Phaser.Geom.Point} O - [out,$return]
*
- * @param {Phaser.Geom.Point} pointA - [description]
- * @param {Phaser.Geom.Point} pointB - [description]
- * @param {Phaser.Geom.Point} [out] - [description]
+ * @param {Phaser.Geom.Point} pointA - Point A, to be projected onto Point B. Must be a normalized point with a magnitude of 1.
+ * @param {Phaser.Geom.Point} pointB - Point B, to have Point A projected upon it.
+ * @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} [description]
+ * @return {Phaser.Geom.Point} A unit Point object holding the coordinates of the vector projection of `pointA` onto `pointB`.
*/
var ProjectUnit = function (pointA, pointB, out)
{
@@ -154503,7 +158743,7 @@ module.exports = ProjectUnit;
/***/ }),
-/* 1141 */
+/* 1159 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154512,7 +158752,7 @@ module.exports = ProjectUnit;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetMagnitude = __webpack_require__(434);
+var GetMagnitude = __webpack_require__(443);
/**
* Changes the magnitude (length) of a two-dimensional vector without changing its direction.
@@ -154547,7 +158787,7 @@ module.exports = SetMagnitude;
/***/ }),
-/* 1142 */
+/* 1160 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154556,23 +158796,24 @@ module.exports = SetMagnitude;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Polygon = __webpack_require__(198);
+var Polygon = __webpack_require__(207);
-Polygon.Clone = __webpack_require__(1143);
-Polygon.Contains = __webpack_require__(199);
-Polygon.ContainsPoint = __webpack_require__(1144);
-Polygon.GetAABB = __webpack_require__(410);
-Polygon.GetNumberArray = __webpack_require__(1145);
-Polygon.GetPoints = __webpack_require__(411);
-Polygon.Perimeter = __webpack_require__(412);
-Polygon.Reverse = __webpack_require__(1146);
-Polygon.Smooth = __webpack_require__(413);
+Polygon.Clone = __webpack_require__(1161);
+Polygon.Contains = __webpack_require__(208);
+Polygon.ContainsPoint = __webpack_require__(1162);
+Polygon.GetAABB = __webpack_require__(418);
+Polygon.GetNumberArray = __webpack_require__(1163);
+Polygon.GetPoints = __webpack_require__(419);
+Polygon.Perimeter = __webpack_require__(420);
+Polygon.Reverse = __webpack_require__(1164);
+Polygon.Smooth = __webpack_require__(421);
+Polygon.Translate = __webpack_require__(1165);
module.exports = Polygon;
/***/ }),
-/* 1143 */
+/* 1161 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154581,7 +158822,7 @@ module.exports = Polygon;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Polygon = __webpack_require__(198);
+var Polygon = __webpack_require__(207);
/**
* Create a new polygon which is a copy of the specified polygon
@@ -154602,7 +158843,7 @@ module.exports = Clone;
/***/ }),
-/* 1144 */
+/* 1162 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154611,18 +158852,18 @@ module.exports = Clone;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Contains = __webpack_require__(199);
+var Contains = __webpack_require__(208);
/**
- * [description]
+ * Checks the given Point again the Polygon to see if the Point lays within its vertices.
*
* @function Phaser.Geom.Polygon.ContainsPoint
* @since 3.0.0
*
- * @param {Phaser.Geom.Polygon} polygon - [description]
- * @param {Phaser.Geom.Point} point - [description]
+ * @param {Phaser.Geom.Polygon} polygon - The Polygon to check.
+ * @param {Phaser.Geom.Point} point - The Point to check if it's within the Polygon.
*
- * @return {boolean} [description]
+ * @return {boolean} `true` if the Point is within the Polygon, otherwise `false`.
*/
var ContainsPoint = function (polygon, point)
{
@@ -154633,7 +158874,7 @@ module.exports = ContainsPoint;
/***/ }),
-/* 1145 */
+/* 1163 */
/***/ (function(module, exports) {
/**
@@ -154676,7 +158917,7 @@ module.exports = GetNumberArray;
/***/ }),
-/* 1146 */
+/* 1164 */
/***/ (function(module, exports) {
/**
@@ -154708,7 +158949,47 @@ module.exports = Reverse;
/***/ }),
-/* 1147 */
+/* 1165 */
+/***/ (function(module, exports) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+/**
+ * Tranlates the points of the given Polygon.
+ *
+ * @function Phaser.Geom.Polygon.Translate
+ * @since 3.50.0
+ *
+ * @generic {Phaser.Geom.Polygon} O - [polygon,$return]
+ *
+ * @param {Phaser.Geom.Polygon} polygon - The Polygon to modify.
+ * @param {number} x - The amount to horizontally translate the points by.
+ * @param {number} y - The amount to vertically translate the points by.
+ *
+ * @return {Phaser.Geom.Polygon} The modified Polygon.
+ */
+var Translate = function (polygon, x, y)
+{
+ var points = polygon.points;
+
+ for (var i = 0; i < points.length; i++)
+ {
+ points[i].x += x;
+ points[i].y += y;
+ }
+
+ return polygon;
+};
+
+module.exports = Translate;
+
+
+/***/ }),
+/* 1166 */
/***/ (function(module, exports) {
/**
@@ -154736,7 +159017,7 @@ module.exports = Area;
/***/ }),
-/* 1148 */
+/* 1167 */
/***/ (function(module, exports) {
/**
@@ -154769,7 +159050,7 @@ module.exports = Ceil;
/***/ }),
-/* 1149 */
+/* 1168 */
/***/ (function(module, exports) {
/**
@@ -154804,7 +159085,7 @@ module.exports = CeilAll;
/***/ }),
-/* 1150 */
+/* 1169 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154813,7 +159094,7 @@ module.exports = CeilAll;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Rectangle = __webpack_require__(11);
+var Rectangle = __webpack_require__(9);
/**
* Creates a new Rectangle which is identical to the given one.
@@ -154834,7 +159115,7 @@ module.exports = Clone;
/***/ }),
-/* 1151 */
+/* 1170 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154843,7 +159124,7 @@ module.exports = Clone;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Contains = __webpack_require__(47);
+var Contains = __webpack_require__(48);
/**
* Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.
@@ -154865,7 +159146,7 @@ module.exports = ContainsPoint;
/***/ }),
-/* 1152 */
+/* 1171 */
/***/ (function(module, exports) {
/**
@@ -154896,7 +159177,7 @@ module.exports = CopyFrom;
/***/ }),
-/* 1153 */
+/* 1172 */
/***/ (function(module, exports) {
/**
@@ -154930,7 +159211,7 @@ module.exports = Equals;
/***/ }),
-/* 1154 */
+/* 1173 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154939,7 +159220,7 @@ module.exports = Equals;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetAspectRatio = __webpack_require__(209);
+var GetAspectRatio = __webpack_require__(218);
/**
* Adjusts the target rectangle, changing its width, height and position,
@@ -154983,7 +159264,7 @@ module.exports = FitInside;
/***/ }),
-/* 1155 */
+/* 1174 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -154992,7 +159273,7 @@ module.exports = FitInside;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetAspectRatio = __webpack_require__(209);
+var GetAspectRatio = __webpack_require__(218);
/**
* Adjusts the target rectangle, changing its width, height and position,
@@ -155036,7 +159317,7 @@ module.exports = FitOutside;
/***/ }),
-/* 1156 */
+/* 1175 */
/***/ (function(module, exports) {
/**
@@ -155069,7 +159350,7 @@ module.exports = Floor;
/***/ }),
-/* 1157 */
+/* 1176 */
/***/ (function(module, exports) {
/**
@@ -155104,7 +159385,50 @@ module.exports = FloorAll;
/***/ }),
-/* 1158 */
+/* 1177 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/**
+ * @author samme
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+var Rectangle = __webpack_require__(9);
+
+/**
+ * Create the smallest Rectangle containing two coordinate pairs.
+ *
+ * @function Phaser.Geom.Rectangle.FromXY
+ * @since 3.23.0
+ *
+ * @generic {Phaser.Geom.Rectangle} O - [out,$return]
+ *
+ * @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.
+ * @param {Phaser.Geom.Rectangle} [out] - Optional Rectangle to adjust.
+ *
+ * @return {Phaser.Geom.Rectangle} The adjusted `out` Rectangle, or a new Rectangle if none was provided.
+ */
+var FromXY = function (x1, y1, x2, y2, out)
+{
+ if (out === undefined) { out = new Rectangle(); }
+
+ return out.setTo(
+ Math.min(x1, x2),
+ Math.min(y1, y2),
+ Math.abs(x1 - x2),
+ Math.abs(y1 - y2)
+ );
+};
+
+module.exports = FromXY;
+
+
+/***/ }),
+/* 1178 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155142,7 +159466,7 @@ module.exports = GetCenter;
/***/ }),
-/* 1159 */
+/* 1179 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155155,18 +159479,18 @@ var Point = __webpack_require__(4);
/**
- * The size of the Rectangle object, expressed as a Point object
- * with the values of the width and height properties.
+ * Returns the size of the Rectangle, expressed as a Point object.
+ * With the value of the `width` as the `x` property and the `height` as the `y` property.
*
* @function Phaser.Geom.Rectangle.GetSize
* @since 3.0.0
*
* @generic {Phaser.Geom.Point} O - [out,$return]
*
- * @param {Phaser.Geom.Rectangle} rect - [description]
- * @param {(Phaser.Geom.Point|object)} [out] - [description]
+ * @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the size from.
+ * @param {(Phaser.Geom.Point|object)} [out] - The Point object to store the size in. If not given, a new Point instance is created.
*
- * @return {(Phaser.Geom.Point|object)} [description]
+ * @return {(Phaser.Geom.Point|object)} A Point object where `x` holds the width and `y` holds the height of the Rectangle.
*/
var GetSize = function (rect, out)
{
@@ -155182,7 +159506,7 @@ module.exports = GetSize;
/***/ }),
-/* 1160 */
+/* 1180 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155191,7 +159515,7 @@ module.exports = GetSize;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CenterOn = __webpack_require__(165);
+var CenterOn = __webpack_require__(173);
/**
@@ -155224,7 +159548,7 @@ module.exports = Inflate;
/***/ }),
-/* 1161 */
+/* 1181 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155233,8 +159557,8 @@ module.exports = Inflate;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Rectangle = __webpack_require__(11);
-var Intersects = __webpack_require__(131);
+var Rectangle = __webpack_require__(9);
+var Intersects = __webpack_require__(137);
/**
* Takes two Rectangles and first checks to see if they intersect.
@@ -155275,7 +159599,7 @@ module.exports = Intersection;
/***/ }),
-/* 1162 */
+/* 1182 */
/***/ (function(module, exports) {
/**
@@ -155324,7 +159648,7 @@ module.exports = MergePoints;
/***/ }),
-/* 1163 */
+/* 1183 */
/***/ (function(module, exports) {
/**
@@ -155371,7 +159695,7 @@ module.exports = MergeRect;
/***/ }),
-/* 1164 */
+/* 1184 */
/***/ (function(module, exports) {
/**
@@ -155415,7 +159739,7 @@ module.exports = MergeXY;
/***/ }),
-/* 1165 */
+/* 1185 */
/***/ (function(module, exports) {
/**
@@ -155450,7 +159774,7 @@ module.exports = Offset;
/***/ }),
-/* 1166 */
+/* 1186 */
/***/ (function(module, exports) {
/**
@@ -155484,7 +159808,7 @@ module.exports = OffsetPoint;
/***/ }),
-/* 1167 */
+/* 1187 */
/***/ (function(module, exports) {
/**
@@ -155518,7 +159842,7 @@ module.exports = Overlaps;
/***/ }),
-/* 1168 */
+/* 1188 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155528,21 +159852,21 @@ module.exports = Overlaps;
*/
var Point = __webpack_require__(4);
-var DegToRad = __webpack_require__(35);
+var DegToRad = __webpack_require__(39);
/**
- * [description]
+ * Returns a Point from the perimeter of a Rectangle based on the given angle.
*
* @function Phaser.Geom.Rectangle.PerimeterPoint
* @since 3.0.0
*
* @generic {Phaser.Geom.Point} O - [out,$return]
*
- * @param {Phaser.Geom.Rectangle} rectangle - [description]
- * @param {integer} angle - [description]
- * @param {Phaser.Geom.Point} [out] - [description]
+ * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from.
+ * @param {integer} 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} [description]
+ * @return {Phaser.Geom.Point} A Point object holding the coordinates of the Rectangle perimeter.
*/
var PerimeterPoint = function (rectangle, angle, out)
{
@@ -155575,7 +159899,7 @@ module.exports = PerimeterPoint;
/***/ }),
-/* 1169 */
+/* 1189 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155584,8 +159908,8 @@ module.exports = PerimeterPoint;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Between = __webpack_require__(170);
-var ContainsRect = __webpack_require__(437);
+var Between = __webpack_require__(177);
+var ContainsRect = __webpack_require__(446);
var Point = __webpack_require__(4);
/**
@@ -155646,7 +159970,7 @@ module.exports = RandomOutside;
/***/ }),
-/* 1170 */
+/* 1190 */
/***/ (function(module, exports) {
/**
@@ -155675,7 +159999,7 @@ module.exports = SameDimensions;
/***/ }),
-/* 1171 */
+/* 1191 */
/***/ (function(module, exports) {
/**
@@ -155714,7 +160038,7 @@ module.exports = Scale;
/***/ }),
-/* 1172 */
+/* 1192 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155725,36 +160049,36 @@ module.exports = Scale;
var Triangle = __webpack_require__(71);
-Triangle.Area = __webpack_require__(1173);
-Triangle.BuildEquilateral = __webpack_require__(1174);
-Triangle.BuildFromPolygon = __webpack_require__(1175);
-Triangle.BuildRight = __webpack_require__(1176);
-Triangle.CenterOn = __webpack_require__(1177);
-Triangle.Centroid = __webpack_require__(438);
-Triangle.CircumCenter = __webpack_require__(1178);
-Triangle.CircumCircle = __webpack_require__(1179);
-Triangle.Clone = __webpack_require__(1180);
+Triangle.Area = __webpack_require__(1193);
+Triangle.BuildEquilateral = __webpack_require__(1194);
+Triangle.BuildFromPolygon = __webpack_require__(1195);
+Triangle.BuildRight = __webpack_require__(1196);
+Triangle.CenterOn = __webpack_require__(1197);
+Triangle.Centroid = __webpack_require__(447);
+Triangle.CircumCenter = __webpack_require__(1198);
+Triangle.CircumCircle = __webpack_require__(1199);
+Triangle.Clone = __webpack_require__(1200);
Triangle.Contains = __webpack_require__(83);
-Triangle.ContainsArray = __webpack_require__(207);
-Triangle.ContainsPoint = __webpack_require__(1181);
-Triangle.CopyFrom = __webpack_require__(1182);
-Triangle.Decompose = __webpack_require__(431);
-Triangle.Equals = __webpack_require__(1183);
-Triangle.GetPoint = __webpack_require__(417);
-Triangle.GetPoints = __webpack_require__(418);
-Triangle.InCenter = __webpack_require__(440);
-Triangle.Perimeter = __webpack_require__(1184);
-Triangle.Offset = __webpack_require__(439);
-Triangle.Random = __webpack_require__(155);
-Triangle.Rotate = __webpack_require__(1185);
-Triangle.RotateAroundPoint = __webpack_require__(1186);
-Triangle.RotateAroundXY = __webpack_require__(210);
+Triangle.ContainsArray = __webpack_require__(216);
+Triangle.ContainsPoint = __webpack_require__(1201);
+Triangle.CopyFrom = __webpack_require__(1202);
+Triangle.Decompose = __webpack_require__(440);
+Triangle.Equals = __webpack_require__(1203);
+Triangle.GetPoint = __webpack_require__(425);
+Triangle.GetPoints = __webpack_require__(426);
+Triangle.InCenter = __webpack_require__(449);
+Triangle.Perimeter = __webpack_require__(1204);
+Triangle.Offset = __webpack_require__(448);
+Triangle.Random = __webpack_require__(163);
+Triangle.Rotate = __webpack_require__(1205);
+Triangle.RotateAroundPoint = __webpack_require__(1206);
+Triangle.RotateAroundXY = __webpack_require__(219);
module.exports = Triangle;
/***/ }),
-/* 1173 */
+/* 1193 */
/***/ (function(module, exports) {
/**
@@ -155793,7 +160117,7 @@ module.exports = Area;
/***/ }),
-/* 1174 */
+/* 1194 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155837,7 +160161,7 @@ module.exports = BuildEquilateral;
/***/ }),
-/* 1175 */
+/* 1195 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155850,7 +160174,8 @@ var EarCut = __webpack_require__(66);
var Triangle = __webpack_require__(71);
/**
- * [description]
+ * Takes an array of vertex coordinates, and optionally an array of hole indices, then returns an array
+ * of Triangle instances, where the given vertices have been decomposed into a series of triangles.
*
* @function Phaser.Geom.Triangle.BuildFromPolygon
* @since 3.0.0
@@ -155859,11 +160184,11 @@ var Triangle = __webpack_require__(71);
*
* @param {array} data - A flat array of vertex coordinates like [x0,y0, x1,y1, x2,y2, ...]
* @param {array} [holes=null] - 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 {number} [scaleX=1] - [description]
- * @param {number} [scaleY=1] - [description]
- * @param {(array|Phaser.Geom.Triangle[])} [out] - [description]
+ * @param {number} [scaleX=1] - Horizontal scale factor to multiply the resulting points by.
+ * @param {number} [scaleY=1] - Vertical scale factor to multiply the resulting points by.
+ * @param {(array|Phaser.Geom.Triangle[])} [out] - An array to store the resulting Triangle instances in. If not provided, a new array is created.
*
- * @return {(array|Phaser.Geom.Triangle[])} [description]
+ * @return {(array|Phaser.Geom.Triangle[])} An array of Triangle instances, where each triangle is based on the decomposed vertices data.
*/
var BuildFromPolygon = function (data, holes, scaleX, scaleY, out)
{
@@ -155912,7 +160237,7 @@ module.exports = BuildFromPolygon;
/***/ }),
-/* 1176 */
+/* 1196 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155961,7 +160286,7 @@ module.exports = BuildRight;
/***/ }),
-/* 1177 */
+/* 1197 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -155970,8 +160295,8 @@ module.exports = BuildRight;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Centroid = __webpack_require__(438);
-var Offset = __webpack_require__(439);
+var Centroid = __webpack_require__(447);
+var Offset = __webpack_require__(448);
/**
* @callback CenterFunction
@@ -156014,7 +160339,7 @@ module.exports = CenterOn;
/***/ }),
-/* 1178 */
+/* 1198 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156058,10 +160383,10 @@ function det (m00, m01, m10, m11)
*
* @generic {Phaser.Math.Vector2} O - [out,$return]
*
- * @param {Phaser.Geom.Triangle} triangle - [description]
- * @param {Phaser.Math.Vector2} [out] - [description]
+ * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the circumcenter of.
+ * @param {Phaser.Math.Vector2} [out] - The Vector2 object to store the position in. If not given, a new Vector2 instance is created.
*
- * @return {Phaser.Math.Vector2} [description]
+ * @return {Phaser.Math.Vector2} A Vector2 object holding the coordinates of the circumcenter of the Triangle.
*/
var CircumCenter = function (triangle, out)
{
@@ -156090,7 +160415,7 @@ module.exports = CircumCenter;
/***/ }),
-/* 1179 */
+/* 1199 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156173,7 +160498,7 @@ module.exports = CircumCircle;
/***/ }),
-/* 1180 */
+/* 1200 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156203,7 +160528,7 @@ module.exports = Clone;
/***/ }),
-/* 1181 */
+/* 1201 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156234,7 +160559,7 @@ module.exports = ContainsPoint;
/***/ }),
-/* 1182 */
+/* 1202 */
/***/ (function(module, exports) {
/**
@@ -156265,7 +160590,7 @@ module.exports = CopyFrom;
/***/ }),
-/* 1183 */
+/* 1203 */
/***/ (function(module, exports) {
/**
@@ -156301,7 +160626,7 @@ module.exports = Equals;
/***/ }),
-/* 1184 */
+/* 1204 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156312,17 +160637,16 @@ module.exports = Equals;
var Length = __webpack_require__(57);
-// The 2D area of a triangle. The area value is always non-negative.
-
/**
* Gets the length of the perimeter of the given triangle.
+ * Calculated by adding together the length of each of the three sides.
*
* @function Phaser.Geom.Triangle.Perimeter
* @since 3.0.0
*
- * @param {Phaser.Geom.Triangle} triangle - [description]
+ * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the length from.
*
- * @return {number} [description]
+ * @return {number} The length of the Triangle.
*/
var Perimeter = function (triangle)
{
@@ -156337,7 +160661,7 @@ module.exports = Perimeter;
/***/ }),
-/* 1185 */
+/* 1205 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156346,8 +160670,8 @@ module.exports = Perimeter;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RotateAroundXY = __webpack_require__(210);
-var InCenter = __webpack_require__(440);
+var RotateAroundXY = __webpack_require__(219);
+var InCenter = __webpack_require__(449);
/**
* Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet.
@@ -156373,7 +160697,7 @@ module.exports = Rotate;
/***/ }),
-/* 1186 */
+/* 1206 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156382,7 +160706,7 @@ module.exports = Rotate;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RotateAroundXY = __webpack_require__(210);
+var RotateAroundXY = __webpack_require__(219);
/**
* Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties.
@@ -156407,7 +160731,7 @@ module.exports = RotateAroundPoint;
/***/ }),
-/* 1187 */
+/* 1207 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156416,8 +160740,8 @@ module.exports = RotateAroundPoint;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CONST = __webpack_require__(177);
-var Extend = __webpack_require__(17);
+var CONST = __webpack_require__(185);
+var Extend = __webpack_require__(19);
/**
* @namespace Phaser.Input
@@ -156425,16 +160749,16 @@ var Extend = __webpack_require__(17);
var Input = {
- CreateInteractiveObject: __webpack_require__(441),
- Events: __webpack_require__(54),
- Gamepad: __webpack_require__(1188),
- InputManager: __webpack_require__(359),
- InputPlugin: __webpack_require__(1200),
- InputPluginCache: __webpack_require__(132),
- Keyboard: __webpack_require__(1202),
- Mouse: __webpack_require__(1219),
- Pointer: __webpack_require__(362),
- Touch: __webpack_require__(1220)
+ CreateInteractiveObject: __webpack_require__(450),
+ Events: __webpack_require__(55),
+ Gamepad: __webpack_require__(1208),
+ InputManager: __webpack_require__(365),
+ InputPlugin: __webpack_require__(1220),
+ InputPluginCache: __webpack_require__(138),
+ Keyboard: __webpack_require__(1222),
+ Mouse: __webpack_require__(1239),
+ Pointer: __webpack_require__(368),
+ Touch: __webpack_require__(1240)
};
@@ -156445,7 +160769,7 @@ module.exports = Input;
/***/ }),
-/* 1188 */
+/* 1208 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156460,18 +160784,18 @@ module.exports = Input;
module.exports = {
- Axis: __webpack_require__(442),
- Button: __webpack_require__(443),
- Events: __webpack_require__(211),
- Gamepad: __webpack_require__(444),
- GamepadPlugin: __webpack_require__(1195),
+ Axis: __webpack_require__(451),
+ Button: __webpack_require__(452),
+ Events: __webpack_require__(220),
+ Gamepad: __webpack_require__(453),
+ GamepadPlugin: __webpack_require__(1215),
- Configs: __webpack_require__(1196)
+ Configs: __webpack_require__(1216)
};
/***/ }),
-/* 1189 */
+/* 1209 */
/***/ (function(module, exports) {
/**
@@ -156500,7 +160824,7 @@ module.exports = 'down';
/***/ }),
-/* 1190 */
+/* 1210 */
/***/ (function(module, exports) {
/**
@@ -156529,7 +160853,7 @@ module.exports = 'up';
/***/ }),
-/* 1191 */
+/* 1211 */
/***/ (function(module, exports) {
/**
@@ -156560,7 +160884,7 @@ module.exports = 'connected';
/***/ }),
-/* 1192 */
+/* 1212 */
/***/ (function(module, exports) {
/**
@@ -156586,7 +160910,7 @@ module.exports = 'disconnected';
/***/ }),
-/* 1193 */
+/* 1213 */
/***/ (function(module, exports) {
/**
@@ -156618,7 +160942,7 @@ module.exports = 'down';
/***/ }),
-/* 1194 */
+/* 1214 */
/***/ (function(module, exports) {
/**
@@ -156650,7 +160974,7 @@ module.exports = 'up';
/***/ }),
-/* 1195 */
+/* 1215 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -156660,12 +160984,12 @@ module.exports = 'up';
*/
var Class = __webpack_require__(0);
-var EventEmitter = __webpack_require__(9);
-var Events = __webpack_require__(211);
-var Gamepad = __webpack_require__(444);
+var EventEmitter = __webpack_require__(11);
+var Events = __webpack_require__(220);
+var Gamepad = __webpack_require__(453);
var GetValue = __webpack_require__(6);
-var InputPluginCache = __webpack_require__(132);
-var InputEvents = __webpack_require__(54);
+var InputPluginCache = __webpack_require__(138);
+var InputEvents = __webpack_require__(55);
/**
* @classdesc
@@ -157288,7 +161612,7 @@ module.exports = GamepadPlugin;
/***/ }),
-/* 1196 */
+/* 1216 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -157303,15 +161627,15 @@ module.exports = GamepadPlugin;
module.exports = {
- DUALSHOCK_4: __webpack_require__(1197),
- SNES_USB: __webpack_require__(1198),
- XBOX_360: __webpack_require__(1199)
+ DUALSHOCK_4: __webpack_require__(1217),
+ SNES_USB: __webpack_require__(1218),
+ XBOX_360: __webpack_require__(1219)
};
/***/ }),
-/* 1197 */
+/* 1217 */
/***/ (function(module, exports) {
/**
@@ -157361,7 +161685,7 @@ module.exports = {
/***/ }),
-/* 1198 */
+/* 1218 */
/***/ (function(module, exports) {
/**
@@ -157400,7 +161724,7 @@ module.exports = {
/***/ }),
-/* 1199 */
+/* 1219 */
/***/ (function(module, exports) {
/**
@@ -157451,7 +161775,7 @@ module.exports = {
/***/ }),
-/* 1200 */
+/* 1220 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -157461,24 +161785,24 @@ module.exports = {
*/
var Circle = __webpack_require__(65);
-var CircleContains = __webpack_require__(55);
+var CircleContains = __webpack_require__(56);
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(177);
-var CreateInteractiveObject = __webpack_require__(441);
-var CreatePixelPerfectHandler = __webpack_require__(1201);
-var DistanceBetween = __webpack_require__(53);
-var Ellipse = __webpack_require__(95);
-var EllipseContains = __webpack_require__(96);
-var Events = __webpack_require__(54);
-var EventEmitter = __webpack_require__(9);
+var CONST = __webpack_require__(185);
+var CreateInteractiveObject = __webpack_require__(450);
+var CreatePixelPerfectHandler = __webpack_require__(1221);
+var DistanceBetween = __webpack_require__(54);
+var Ellipse = __webpack_require__(96);
+var EllipseContains = __webpack_require__(97);
+var Events = __webpack_require__(55);
+var EventEmitter = __webpack_require__(11);
var GetFastValue = __webpack_require__(2);
-var GEOM_CONST = __webpack_require__(46);
-var InputPluginCache = __webpack_require__(132);
+var GEOM_CONST = __webpack_require__(47);
+var InputPluginCache = __webpack_require__(138);
var IsPlainObject = __webpack_require__(7);
var PluginCache = __webpack_require__(23);
-var Rectangle = __webpack_require__(11);
-var RectangleContains = __webpack_require__(47);
-var SceneEvents = __webpack_require__(19);
+var Rectangle = __webpack_require__(9);
+var RectangleContains = __webpack_require__(48);
+var SceneEvents = __webpack_require__(22);
var Triangle = __webpack_require__(71);
var TriangleContains = __webpack_require__(83);
@@ -157512,6 +161836,13 @@ var TriangleContains = __webpack_require__(83);
*
* 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
* @memberof Phaser.Input
@@ -158311,13 +162642,13 @@ var InputPlugin = new Class({
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to be enabled for input.
- * @param {(Phaser.Types.Input.InputConfiguration|any)} [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 {Phaser.Types.Input.HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area.
+ * @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 specified a Rectangle will be used.
+ * @param {Phaser.Types.Input.HitAreaCallback} [hitAreaCallback] - The 'contains' function to invoke to check if the pointer is within the hit area.
* @param {boolean} [dropZone=false] - Is this Game Object a drop zone or not?
*
- * @return {Phaser.Input.InputPlugin} This Input Plugin.
+ * @return {this} This Input Plugin.
*/
- enable: function (gameObject, shape, callback, dropZone)
+ enable: function (gameObject, hitArea, hitAreaCallback, dropZone)
{
if (dropZone === undefined) { dropZone = false; }
@@ -158329,7 +162660,7 @@ var InputPlugin = new Class({
else
{
// Create an InteractiveObject and enable it
- this.setHitArea(gameObject, shape, callback);
+ this.setHitArea(gameObject, hitArea, hitAreaCallback);
}
if (gameObject.input && dropZone && !gameObject.input.dropZone)
@@ -158582,8 +162913,8 @@ var InputPlugin = new Class({
input.dragStartX = gameObject.x;
input.dragStartY = gameObject.y;
- input.dragStartXGlobal = pointer.x;
- input.dragStartYGlobal = pointer.y;
+ input.dragStartXGlobal = pointer.worldX;
+ input.dragStartYGlobal = pointer.worldY;
input.dragX = input.dragStartXGlobal - input.dragStartX;
input.dragY = input.dragStartYGlobal - input.dragStartY;
@@ -158786,13 +163117,13 @@ var InputPlugin = new Class({
if (!gameObject.parentContainer)
{
- dragX = pointer.x - input.dragX;
- dragY = pointer.y - input.dragY;
+ dragX = pointer.worldX - input.dragX;
+ dragY = pointer.worldY - input.dragY;
}
else
{
- var dx = pointer.x - input.dragStartXGlobal;
- var dy = pointer.y - input.dragStartYGlobal;
+ var dx = pointer.worldX - input.dragStartXGlobal;
+ var dy = pointer.worldY - input.dragStartYGlobal;
var rotation = gameObject.getParentRotation();
@@ -159435,7 +163766,7 @@ var InputPlugin = new Class({
*
* @param {Phaser.GameObjects.GameObject} child - The Game Object to add.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
queueForInsertion: function (child)
{
@@ -159456,7 +163787,7 @@ var InputPlugin = new Class({
*
* @param {Phaser.GameObjects.GameObject} child - The Game Object to remove.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
queueForRemoval: function (child)
{
@@ -159478,7 +163809,7 @@ var InputPlugin = new Class({
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to change the draggable state on.
* @param {boolean} [value=true] - Set to `true` if the Game Objects should be made draggable, `false` if they should be unset.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setDraggable: function (gameObjects, value)
{
@@ -159569,14 +163900,14 @@ var InputPlugin = new Class({
* @since 3.0.0
*
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set the hit area on.
- * @param {(Phaser.Types.Input.InputConfiguration|any)} [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 {Phaser.Types.Input.HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area.
+ * @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 specified a Rectangle will be used.
+ * @param {Phaser.Types.Input.HitAreaCallback} [hitAreaCallback] - The 'contains' function to invoke to check if the pointer is within the hit area.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
- setHitArea: function (gameObjects, shape, callback)
+ setHitArea: function (gameObjects, hitArea, hitAreaCallback)
{
- if (shape === undefined)
+ if (hitArea === undefined)
{
return this.setHitAreaFromTexture(gameObjects);
}
@@ -159594,12 +163925,12 @@ var InputPlugin = new Class({
var customHitArea = true;
// Config object?
- if (IsPlainObject(shape))
+ if (IsPlainObject(hitArea))
{
- var config = shape;
+ var config = hitArea;
- shape = GetFastValue(config, 'hitArea', null);
- callback = GetFastValue(config, 'hitAreaCallback', null);
+ hitArea = GetFastValue(config, 'hitArea', null);
+ hitAreaCallback = GetFastValue(config, 'hitAreaCallback', null);
draggable = GetFastValue(config, 'draggable', false);
dropZone = GetFastValue(config, 'dropZone', false);
cursor = GetFastValue(config, 'cursor', false);
@@ -159610,21 +163941,21 @@ var InputPlugin = new Class({
if (pixelPerfect)
{
- shape = {};
- callback = this.makePixelPerfect(alphaTolerance);
+ hitArea = {};
+ hitAreaCallback = this.makePixelPerfect(alphaTolerance);
}
// Still no hitArea or callback?
- if (!shape || !callback)
+ if (!hitArea || !hitAreaCallback)
{
this.setHitAreaFromTexture(gameObjects);
customHitArea = false;
}
}
- else if (typeof shape === 'function' && !callback)
+ else if (typeof hitArea === 'function' && !hitAreaCallback)
{
- callback = shape;
- shape = {};
+ hitAreaCallback = hitArea;
+ hitArea = {};
}
for (var i = 0; i < gameObjects.length; i++)
@@ -159637,7 +163968,7 @@ var InputPlugin = new Class({
continue;
}
- var io = (!gameObject.input) ? CreateInteractiveObject(gameObject, shape, callback) : gameObject.input;
+ var io = (!gameObject.input) ? CreateInteractiveObject(gameObject, hitArea, hitAreaCallback) : gameObject.input;
io.customHitArea = customHitArea;
io.dropZone = dropZone;
@@ -159669,7 +164000,7 @@ var InputPlugin = new Class({
* @param {number} radius - The radius of the circle.
* @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Circle.Contains.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setHitAreaCircle: function (gameObjects, x, y, radius, callback)
{
@@ -159694,7 +164025,7 @@ var InputPlugin = new Class({
* @param {number} height - The height of the ellipse.
* @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Ellipse.Contains.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setHitAreaEllipse: function (gameObjects, x, y, width, height, callback)
{
@@ -159715,7 +164046,7 @@ var InputPlugin = new Class({
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area.
* @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setHitAreaFromTexture: function (gameObjects, callback)
{
@@ -159777,7 +164108,7 @@ var InputPlugin = new Class({
* @param {number} height - The height of the rectangle.
* @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setHitAreaRectangle: function (gameObjects, x, y, width, height, callback)
{
@@ -159804,7 +164135,7 @@ var InputPlugin = new Class({
* @param {number} y3 - The y coordinate of the third point of the triangle.
* @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Triangle.Contains.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setHitAreaTriangle: function (gameObjects, x1, y1, x2, y2, x3, y3, callback)
{
@@ -159846,7 +164177,7 @@ var InputPlugin = new Class({
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to create the input debug shape for.
* @param {number} [color=0x00ff00] - The outline color of the debug shape.
*
- * @return {Phaser.Input.InputPlugin} This Input Plugin.
+ * @return {this} This Input Plugin.
*/
enableDebug: function (gameObject, color)
{
@@ -159918,10 +164249,29 @@ var InputPlugin = new Class({
debug.setStrokeStyle(1 / gameObject.scale, color);
debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY);
- debug.setRotation(gameObject.rotation);
- debug.setScale(gameObject.scaleX, gameObject.scaleY);
- debug.setPosition(gameObject.x + offsetx, gameObject.y + offsety);
+
+ var x = gameObject.x;
+ var y = gameObject.y;
+ var rotation = gameObject.rotation;
+ var scaleX = gameObject.scaleX;
+ var scaleY = gameObject.scaleY;
+
+ if (gameObject.parentContainer)
+ {
+ var matrix = gameObject.getWorldTransformMatrix();
+
+ x = matrix.tx;
+ y = matrix.ty;
+ rotation = matrix.rotation;
+ scaleX = matrix.scaleX;
+ scaleY = matrix.scaleY;
+ }
+
+ debug.setRotation(rotation);
+ debug.setScale(scaleX, scaleY);
+ debug.setPosition(x + offsetx, y + offsety);
debug.setScrollFactor(gameObject.scrollFactorX, gameObject.scrollFactorY);
+ debug.setDepth(gameObject.depth);
};
updateList.add(debug);
@@ -159942,7 +164292,7 @@ var InputPlugin = new Class({
*
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to remove the input debug shape from.
*
- * @return {Phaser.Input.InputPlugin} This Input Plugin.
+ * @return {this} This Input Plugin.
*/
removeDebug: function (gameObject)
{
@@ -159975,7 +164325,7 @@ var InputPlugin = new Class({
* @method Phaser.Input.InputPlugin#setPollAlways
* @since 3.0.0
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setPollAlways: function ()
{
@@ -159991,7 +164341,7 @@ var InputPlugin = new Class({
* @method Phaser.Input.InputPlugin#setPollOnMove
* @since 3.0.0
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setPollOnMove: function ()
{
@@ -160007,7 +164357,7 @@ var InputPlugin = new Class({
*
* @param {number} value - The amount of time, in ms, that should elapsed before re-polling the pointers.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setPollRate: function (value)
{
@@ -160027,7 +164377,7 @@ var InputPlugin = new Class({
*
* @param {boolean} value - Set to `true` to stop processing input events on the Scene that receives it, or `false` to let the event continue down the Scene list.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setGlobalTopOnly: function (value)
{
@@ -160047,7 +164397,7 @@ var InputPlugin = new Class({
*
* @param {boolean} value - `true` to only include the top-most Game Object, or `false` to include all Game Objects in a hit test.
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
setTopOnly: function (value)
{
@@ -160137,9 +164487,12 @@ var InputPlugin = new Class({
return indexB - indexA;
}
}
+
+ return listB.length - listA.length;
}
// Technically this shouldn't happen, but ...
+ // eslint-disable-next-line no-unreachable
return 0;
},
@@ -160152,7 +164505,7 @@ var InputPlugin = new Class({
* @method Phaser.Input.InputPlugin#stopPropagation
* @since 3.0.0
*
- * @return {Phaser.Input.InputPlugin} This InputPlugin object.
+ * @return {this} This InputPlugin object.
*/
stopPropagation: function ()
{
@@ -160209,7 +164562,7 @@ var InputPlugin = new Class({
*
* @param {string} cursor - The CSS to be used when setting the default cursor.
*
- * @return {Phaser.Input.InputPlugin} This Input instance.
+ * @return {this} This Input instance.
*/
setDefaultCursor: function (cursor)
{
@@ -160603,7 +164956,7 @@ module.exports = InputPlugin;
/***/ }),
-/* 1201 */
+/* 1221 */
/***/ (function(module, exports) {
/**
@@ -160639,7 +164992,7 @@ module.exports = CreatePixelPerfectHandler;
/***/ }),
-/* 1202 */
+/* 1222 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -160654,26 +165007,26 @@ module.exports = CreatePixelPerfectHandler;
module.exports = {
- Events: __webpack_require__(133),
+ Events: __webpack_require__(139),
- KeyboardManager: __webpack_require__(360),
- KeyboardPlugin: __webpack_require__(1210),
+ KeyboardManager: __webpack_require__(366),
+ KeyboardPlugin: __webpack_require__(1230),
- Key: __webpack_require__(445),
- KeyCodes: __webpack_require__(122),
+ Key: __webpack_require__(454),
+ KeyCodes: __webpack_require__(126),
- KeyCombo: __webpack_require__(446),
+ KeyCombo: __webpack_require__(455),
- JustDown: __webpack_require__(1215),
- JustUp: __webpack_require__(1216),
- DownDuration: __webpack_require__(1217),
- UpDuration: __webpack_require__(1218)
+ JustDown: __webpack_require__(1235),
+ JustUp: __webpack_require__(1236),
+ DownDuration: __webpack_require__(1237),
+ UpDuration: __webpack_require__(1238)
};
/***/ }),
-/* 1203 */
+/* 1223 */
/***/ (function(module, exports) {
/**
@@ -160709,7 +165062,7 @@ module.exports = 'keydown';
/***/ }),
-/* 1204 */
+/* 1224 */
/***/ (function(module, exports) {
/**
@@ -160738,7 +165091,7 @@ module.exports = 'keyup';
/***/ }),
-/* 1205 */
+/* 1225 */
/***/ (function(module, exports) {
/**
@@ -160772,7 +165125,7 @@ module.exports = 'keycombomatch';
/***/ }),
-/* 1206 */
+/* 1226 */
/***/ (function(module, exports) {
/**
@@ -160806,7 +165159,7 @@ module.exports = 'down';
/***/ }),
-/* 1207 */
+/* 1227 */
/***/ (function(module, exports) {
/**
@@ -160845,7 +165198,7 @@ module.exports = 'keydown-';
/***/ }),
-/* 1208 */
+/* 1228 */
/***/ (function(module, exports) {
/**
@@ -160877,7 +165230,7 @@ module.exports = 'keyup-';
/***/ }),
-/* 1209 */
+/* 1229 */
/***/ (function(module, exports) {
/**
@@ -160911,7 +165264,7 @@ module.exports = 'up';
/***/ }),
-/* 1210 */
+/* 1230 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -160921,26 +165274,26 @@ module.exports = 'up';
*/
var Class = __webpack_require__(0);
-var EventEmitter = __webpack_require__(9);
-var Events = __webpack_require__(133);
-var GameEvents = __webpack_require__(18);
+var EventEmitter = __webpack_require__(11);
+var Events = __webpack_require__(139);
+var GameEvents = __webpack_require__(20);
var GetValue = __webpack_require__(6);
-var InputEvents = __webpack_require__(54);
-var InputPluginCache = __webpack_require__(132);
-var Key = __webpack_require__(445);
-var KeyCodes = __webpack_require__(122);
-var KeyCombo = __webpack_require__(446);
-var KeyMap = __webpack_require__(1214);
+var InputEvents = __webpack_require__(55);
+var InputPluginCache = __webpack_require__(138);
+var Key = __webpack_require__(454);
+var KeyCodes = __webpack_require__(126);
+var KeyCombo = __webpack_require__(455);
+var KeyMap = __webpack_require__(1234);
var SnapFloor = __webpack_require__(93);
/**
* @classdesc
* The Keyboard Plugin is an input plugin that belongs to the Scene-owned Input system.
- *
+ *
* Its role is to listen for native DOM Keyboard Events and then process them.
- *
+ *
* You do not need to create this class directly, the Input system will create an instance of it automatically.
- *
+ *
* You can access it from within a Scene using `this.input.keyboard`. For example, you can do:
*
* ```javascript
@@ -160948,7 +165301,7 @@ var SnapFloor = __webpack_require__(93);
* ```
*
* Or, to listen for a specific key:
- *
+ *
* ```javascript
* this.input.keyboard.on('keydown-A', callback, context);
* ```
@@ -160958,7 +165311,7 @@ var SnapFloor = __webpack_require__(93);
* ```javascript
* var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);
* ```
- *
+ *
* If you have multiple parallel Scenes, each trying to get keyboard input, be sure to disable capture on them to stop them from
* stealing input from another Scene in the list. You can do this with `this.input.keyboard.enabled = false` within the
* Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene.
@@ -161062,6 +165415,26 @@ var KeyboardPlugin = new Class({
*/
this.combos = [];
+ /**
+ * Internal repeat key flag.
+ *
+ * @name Phaser.Input.Keyboard.KeyboardPlugin#prevCode
+ * @type {string}
+ * @private
+ * @since 3.50.0
+ */
+ this.prevCode = null;
+
+ /**
+ * Internal repeat key flag.
+ *
+ * @name Phaser.Input.Keyboard.KeyboardPlugin#prevTime
+ * @type {number}
+ * @private
+ * @since 3.50.0
+ */
+ this.prevTime = 0;
+
sceneInputPlugin.pluginEvents.once(InputEvents.BOOT, this.boot, this);
sceneInputPlugin.pluginEvents.on(InputEvents.START, this.start, this);
},
@@ -161101,14 +165474,7 @@ var KeyboardPlugin = new Class({
*/
start: function ()
{
- if (this.sceneInputPlugin.manager.useQueue)
- {
- this.sceneInputPlugin.pluginEvents.on(InputEvents.UPDATE, this.update, this);
- }
- else
- {
- this.sceneInputPlugin.manager.events.on(InputEvents.MANAGER_PROCESS, this.update, this);
- }
+ this.sceneInputPlugin.manager.events.on(InputEvents.MANAGER_PROCESS, this.update, this);
this.sceneInputPlugin.pluginEvents.once(InputEvents.SHUTDOWN, this.shutdown, this);
@@ -161134,38 +165500,38 @@ var KeyboardPlugin = new Class({
*
* This `addCapture` method enables consuming keyboard events for specific keys, so they don't bubble up the browser
* and cause the default behaviors.
- *
+ *
* Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent
* the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one.
- *
+ *
* You can pass a single key code value:
- *
+ *
* ```javascript
* this.input.keyboard.addCapture(62);
* ```
- *
+ *
* An array of key codes:
- *
+ *
* ```javascript
* this.input.keyboard.addCapture([ 62, 63, 64 ]);
* ```
- *
+ *
* Or, a comma-delimited string:
- *
+ *
* ```javascript
* this.input.keyboard.addCapture('W,S,A,D');
* ```
- *
+ *
* To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'.
- *
+ *
* You can also provide an array mixing both strings and key code integers.
*
* @method Phaser.Input.Keyboard.KeyboardPlugin#addCapture
* @since 3.16.0
- *
+ *
* @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable event capture for.
*
- * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.
+ * @return {this} This KeyboardPlugin object.
*/
addCapture: function (keycode)
{
@@ -161176,38 +165542,38 @@ var KeyboardPlugin = new Class({
/**
* Removes an existing key capture.
- *
+ *
* Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove
* the capture of a key, then it will remove it for any Scene in your game, not just the calling one.
- *
+ *
* You can pass a single key code value:
- *
+ *
* ```javascript
* this.input.keyboard.removeCapture(62);
* ```
- *
+ *
* An array of key codes:
- *
+ *
* ```javascript
* this.input.keyboard.removeCapture([ 62, 63, 64 ]);
* ```
- *
+ *
* Or, a comma-delimited string:
- *
+ *
* ```javascript
* this.input.keyboard.removeCapture('W,S,A,D');
* ```
- *
+ *
* To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'.
- *
+ *
* You can also provide an array mixing both strings and key code integers.
*
* @method Phaser.Input.Keyboard.KeyboardPlugin#removeCapture
* @since 3.16.0
- *
+ *
* @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable event capture for.
*
- * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.
+ * @return {this} This KeyboardPlugin object.
*/
removeCapture: function (keycode)
{
@@ -161221,7 +165587,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.
*/
getCaptures: function ()
@@ -161236,7 +165602,7 @@ var KeyboardPlugin = new Class({
* @method Phaser.Input.Keyboard.KeyboardPlugin#enableGlobalCapture
* @since 3.16.0
*
- * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.
+ * @return {this} This KeyboardPlugin object.
*/
enableGlobalCapture: function ()
{
@@ -161252,7 +165618,7 @@ var KeyboardPlugin = new Class({
* @method Phaser.Input.Keyboard.KeyboardPlugin#disableGlobalCapture
* @since 3.16.0
*
- * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.
+ * @return {this} This KeyboardPlugin object.
*/
disableGlobalCapture: function ()
{
@@ -161263,13 +165629,13 @@ var KeyboardPlugin = new Class({
/**
* Removes all keyboard captures.
- *
+ *
* Note that this is a global change. It will clear all event captures across your game, not just for this specific Scene.
*
* @method Phaser.Input.Keyboard.KeyboardPlugin#clearCaptures
* @since 3.16.0
*
- * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.
+ * @return {this} This KeyboardPlugin object.
*/
clearCaptures: function ()
{
@@ -161306,11 +165672,11 @@ var KeyboardPlugin = new Class({
* ```javascript
* this.input.keyboard.addKeys({ 'up': Phaser.Input.Keyboard.KeyCodes.W, 'down': Phaser.Input.Keyboard.KeyCodes.S });
* ```
- *
+ *
* would return an object containing the properties (`up` and `down`) mapped to W and S {@link Phaser.Input.Keyboard.Key} objects.
*
* You can also pass in a comma-separated string:
- *
+ *
* ```javascript
* this.input.keyboard.addKeys('W,S,A,D');
* ```
@@ -161437,7 +165803,7 @@ var KeyboardPlugin = new Class({
* @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 {boolean} [destroy=false] - Call `Key.destroy` on the removed Key object?
*
- * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.
+ * @return {this} This KeyboardPlugin object.
*/
removeKey: function (key, destroy)
{
@@ -161482,9 +165848,41 @@ var KeyboardPlugin = new Class({
return this;
},
+ /**
+ * Removes all Key objects created by _this_ Keyboard Plugin.
+ *
+ * @method Phaser.Input.Keyboard.KeyboardPlugin#removeAllKeys
+ * @since 3.24.0
+ *
+ * @param {boolean} [destroy=false] - Call `Key.destroy` on each removed Key object?
+ *
+ * @return {this} This KeyboardPlugin object.
+ */
+ removeAllKeys: function (destroy)
+ {
+ var keys = this.keys;
+
+ for (var i = 0; i < keys.length; i++)
+ {
+ var key = keys[i];
+
+ if (key)
+ {
+ keys[i] = undefined;
+
+ if (destroy)
+ {
+ key.destroy();
+ }
+ }
+ }
+
+ return this;
+ },
+
/**
* Creates a new KeyCombo.
- *
+ *
* A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them
* it will emit a `keycombomatch` event from this Keyboard Plugin.
*
@@ -161526,12 +165924,12 @@ var KeyboardPlugin = new Class({
/**
* Checks if the given Key object is currently being held down.
- *
+ *
* The difference between this method and checking the `Key.isDown` property directly is that you can provide
* a duration to this method. For example, if you wanted a key press to fire a bullet, but you only wanted
* it to be able to fire every 100ms, then you can call this method with a `duration` of 100 and it
* will only return `true` every 100ms.
- *
+ *
* If the Keyboard Plugin has been disabled, this method will always return `false`.
*
* @method Phaser.Input.Keyboard.KeyboardPlugin#checkDown
@@ -161539,11 +165937,13 @@ var KeyboardPlugin = new Class({
*
* @param {Phaser.Input.Keyboard.Key} key - A Key object.
* @param {number} [duration=0] - The duration which must have elapsed before this Key is considered as being down.
- *
+ *
* @return {boolean} `true` if the Key is down within the duration specified, otherwise `false`.
*/
checkDown: function (key, duration)
{
+ if (duration === undefined) { duration = 0; }
+
if (this.enabled && key.isDown)
{
var t = SnapFloor(this.time - key.timeDown, duration);
@@ -161597,7 +165997,7 @@ var KeyboardPlugin = new Class({
{
event.cancelled = 1;
};
-
+
// Won't reach any more handlers in any Scene further down the Scene list
event.stopPropagation = function ()
{
@@ -161611,6 +166011,16 @@ var KeyboardPlugin = new Class({
continue;
}
+ // Duplicate event bailout
+ if (code === this.prevCode && event.timeStamp === this.prevTime)
+ {
+ // On some systems, the exact same event will fire multiple times. This prevents it.
+ continue;
+ }
+
+ this.prevCode = code;
+ this.prevTime = event.timeStamp;
+
if (event.type === 'keydown')
{
// Key specific callback first
@@ -161626,10 +166036,6 @@ var KeyboardPlugin = new Class({
if (KeyMap[code])
{
this.emit(Events.KEY_DOWN + KeyMap[code], event);
-
- // Deprecated, kept in for compatibility with 3.15
- // To be removed by 3.20.
- this.emit('keydown_' + KeyMap[code], event);
}
if (!event.cancelled)
@@ -161651,10 +166057,6 @@ var KeyboardPlugin = new Class({
if (KeyMap[code])
{
this.emit(Events.KEY_UP + KeyMap[code], event);
-
- // Deprecated, kept in for compatibility with 3.15
- // To be removed by 3.20.
- this.emit('keyup_' + KeyMap[code], event);
}
if (!event.cancelled)
@@ -161676,14 +166078,14 @@ var KeyboardPlugin = new Class({
* Resets all Key objects created by _this_ Keyboard Plugin back to their default un-pressed states.
* This can only reset keys created via the `addKey`, `addKeys` or `createCursorKeys` methods.
* If you have created a Key object directly you'll need to reset it yourself.
- *
+ *
* This method is called automatically when the Keyboard Plugin shuts down, but can be
* invoked directly at any time you require.
*
* @method Phaser.Input.Keyboard.KeyboardPlugin#resetKeys
* @since 3.15.0
*
- * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.
+ * @return {this} This KeyboardPlugin object.
*/
resetKeys: function ()
{
@@ -161703,7 +166105,7 @@ var KeyboardPlugin = new Class({
/**
* Shuts this Keyboard Plugin down. This performs the following tasks:
- *
+ *
* 1 - Resets all keys created by this Keyboard plugin.
* 2 - Stops and removes the keyboard event listeners.
* 3 - Clears out any pending requests in the queue, without processing them.
@@ -161716,14 +166118,7 @@ var KeyboardPlugin = new Class({
{
this.resetKeys();
- if (this.sceneInputPlugin.manager.useQueue)
- {
- this.sceneInputPlugin.pluginEvents.off(InputEvents.UPDATE, this.update, this);
- }
- else
- {
- this.sceneInputPlugin.manager.events.off(InputEvents.MANAGER_PROCESS, this.update, this);
- }
+ this.sceneInputPlugin.manager.events.off(InputEvents.MANAGER_PROCESS, this.update, this);
this.game.events.off(GameEvents.BLUR, this.resetKeys);
@@ -161797,7 +166192,7 @@ module.exports = KeyboardPlugin;
/***/ }),
-/* 1211 */
+/* 1231 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -161806,7 +166201,7 @@ module.exports = KeyboardPlugin;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var AdvanceKeyCombo = __webpack_require__(1212);
+var AdvanceKeyCombo = __webpack_require__(1232);
/**
* Used internally by the KeyCombo class.
@@ -161878,7 +166273,7 @@ module.exports = ProcessKeyCombo;
/***/ }),
-/* 1212 */
+/* 1232 */
/***/ (function(module, exports) {
/**
@@ -161920,7 +166315,7 @@ module.exports = AdvanceKeyCombo;
/***/ }),
-/* 1213 */
+/* 1233 */
/***/ (function(module, exports) {
/**
@@ -161955,7 +166350,7 @@ module.exports = ResetKeyCombo;
/***/ }),
-/* 1214 */
+/* 1234 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -161964,7 +166359,7 @@ module.exports = ResetKeyCombo;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var KeyCodes = __webpack_require__(122);
+var KeyCodes = __webpack_require__(126);
var KeyMap = {};
@@ -161977,7 +166372,7 @@ module.exports = KeyMap;
/***/ }),
-/* 1215 */
+/* 1235 */
/***/ (function(module, exports) {
/**
@@ -162019,7 +166414,7 @@ module.exports = JustDown;
/***/ }),
-/* 1216 */
+/* 1236 */
/***/ (function(module, exports) {
/**
@@ -162061,7 +166456,7 @@ module.exports = JustUp;
/***/ }),
-/* 1217 */
+/* 1237 */
/***/ (function(module, exports) {
/**
@@ -162095,7 +166490,7 @@ module.exports = DownDuration;
/***/ }),
-/* 1218 */
+/* 1238 */
/***/ (function(module, exports) {
/**
@@ -162129,7 +166524,7 @@ module.exports = UpDuration;
/***/ }),
-/* 1219 */
+/* 1239 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -162145,14 +166540,14 @@ module.exports = UpDuration;
/* eslint-disable */
module.exports = {
- MouseManager: __webpack_require__(361)
+ MouseManager: __webpack_require__(367)
};
/* eslint-enable */
/***/ }),
-/* 1220 */
+/* 1240 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -162168,14 +166563,14 @@ module.exports = {
/* eslint-disable */
module.exports = {
- TouchManager: __webpack_require__(363)
+ TouchManager: __webpack_require__(369)
};
/* eslint-enable */
/***/ }),
-/* 1221 */
+/* 1241 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -162184,8 +166579,8 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CONST = __webpack_require__(20);
-var Extend = __webpack_require__(17);
+var CONST = __webpack_require__(18);
+var Extend = __webpack_require__(19);
/**
* @namespace Phaser.Loader
@@ -162193,18 +166588,18 @@ var Extend = __webpack_require__(17);
var Loader = {
- Events: __webpack_require__(81),
+ Events: __webpack_require__(82),
- FileTypes: __webpack_require__(1222),
+ FileTypes: __webpack_require__(1242),
File: __webpack_require__(21),
FileTypesManager: __webpack_require__(8),
- GetURL: __webpack_require__(134),
- LoaderPlugin: __webpack_require__(1246),
- MergeXHRSettings: __webpack_require__(212),
+ GetURL: __webpack_require__(140),
+ LoaderPlugin: __webpack_require__(1266),
+ MergeXHRSettings: __webpack_require__(221),
MultiFile: __webpack_require__(61),
- XHRLoader: __webpack_require__(447),
- XHRSettings: __webpack_require__(135)
+ XHRLoader: __webpack_require__(456),
+ XHRSettings: __webpack_require__(141)
};
@@ -162215,7 +166610,7 @@ module.exports = Loader;
/***/ }),
-/* 1222 */
+/* 1242 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -162230,42 +166625,42 @@ module.exports = Loader;
module.exports = {
- AnimationJSONFile: __webpack_require__(1223),
- AtlasJSONFile: __webpack_require__(1224),
- AtlasXMLFile: __webpack_require__(1225),
- AudioFile: __webpack_require__(448),
- AudioSpriteFile: __webpack_require__(1226),
- BinaryFile: __webpack_require__(1227),
- BitmapFontFile: __webpack_require__(1228),
- CSSFile: __webpack_require__(1229),
- GLSLFile: __webpack_require__(1230),
- HTML5AudioFile: __webpack_require__(449),
- HTMLFile: __webpack_require__(1231),
- HTMLTextureFile: __webpack_require__(1232),
+ AnimationJSONFile: __webpack_require__(1243),
+ AtlasJSONFile: __webpack_require__(1244),
+ AtlasXMLFile: __webpack_require__(1245),
+ AudioFile: __webpack_require__(457),
+ AudioSpriteFile: __webpack_require__(1246),
+ BinaryFile: __webpack_require__(1247),
+ BitmapFontFile: __webpack_require__(1248),
+ CSSFile: __webpack_require__(1249),
+ GLSLFile: __webpack_require__(1250),
+ HTML5AudioFile: __webpack_require__(458),
+ HTMLFile: __webpack_require__(1251),
+ HTMLTextureFile: __webpack_require__(1252),
ImageFile: __webpack_require__(72),
JSONFile: __webpack_require__(60),
- MultiAtlasFile: __webpack_require__(1233),
- MultiScriptFile: __webpack_require__(1234),
- PackFile: __webpack_require__(1235),
- PluginFile: __webpack_require__(1236),
- SceneFile: __webpack_require__(1237),
- ScenePluginFile: __webpack_require__(1238),
- ScriptFile: __webpack_require__(450),
- SpriteSheetFile: __webpack_require__(1239),
- SVGFile: __webpack_require__(1240),
- TextFile: __webpack_require__(451),
- TilemapCSVFile: __webpack_require__(1241),
- TilemapImpactFile: __webpack_require__(1242),
- TilemapJSONFile: __webpack_require__(1243),
- UnityAtlasFile: __webpack_require__(1244),
- VideoFile: __webpack_require__(1245),
- XMLFile: __webpack_require__(213)
+ MultiAtlasFile: __webpack_require__(1253),
+ MultiScriptFile: __webpack_require__(1254),
+ PackFile: __webpack_require__(1255),
+ PluginFile: __webpack_require__(1256),
+ SceneFile: __webpack_require__(1257),
+ ScenePluginFile: __webpack_require__(1258),
+ ScriptFile: __webpack_require__(459),
+ SpriteSheetFile: __webpack_require__(1259),
+ SVGFile: __webpack_require__(1260),
+ TextFile: __webpack_require__(460),
+ TilemapCSVFile: __webpack_require__(1261),
+ TilemapImpactFile: __webpack_require__(1262),
+ TilemapJSONFile: __webpack_require__(1263),
+ UnityAtlasFile: __webpack_require__(1264),
+ VideoFile: __webpack_require__(1265),
+ XMLFile: __webpack_require__(222)
};
/***/ }),
-/* 1223 */
+/* 1243 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -162277,14 +166672,14 @@ module.exports = {
var Class = __webpack_require__(0);
var FileTypesManager = __webpack_require__(8);
var JSONFile = __webpack_require__(60);
-var LoaderEvents = __webpack_require__(81);
+var LoaderEvents = __webpack_require__(82);
/**
* @classdesc
* A single Animation JSON File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#animation method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#animation.
*
* @class AnimationJSONFile
@@ -162340,8 +166735,6 @@ var AnimationJSONFile = new Class({
onLoadComplete: function ()
{
this.loader.systems.anims.fromJSON(this.data);
-
- this.pendingDestroy();
}
});
@@ -162350,7 +166743,7 @@ var AnimationJSONFile = new Class({
* Adds an Animation JSON Data file, or array of Animation 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 ()
* {
@@ -162365,17 +166758,17 @@ var AnimationJSONFile = new Class({
* 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.
- *
+ *
* 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.animation({
* key: 'baddieAnims',
@@ -162392,9 +166785,9 @@ var AnimationJSONFile = new Class({
*
* Once the animation data has been parsed you will be able to play animations using that data.
* Please see the Animation Manager `fromJSON` method for more details about the format and playback.
- *
+ *
* You can also access the raw animation data from its Cache using its key:
- *
+ *
* ```javascript
* this.load.animation('baddieAnims', 'files/BaddieAnims.json');
* // and later in your game ...
@@ -162413,7 +166806,7 @@ var AnimationJSONFile = new Class({
*
* 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": {
@@ -162433,7 +166826,7 @@ var AnimationJSONFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#animation
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @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.
@@ -162441,7 +166834,7 @@ var AnimationJSONFile = new Class({
* @param {string} [dataKey] - When the Animation JSON file loads only this property will be stored in the Cache and used to create animation data.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('animation', function (key, url, dataKey, xhrSettings)
{
@@ -162468,7 +166861,7 @@ module.exports = AnimationJSONFile;
/***/ }),
-/* 1224 */
+/* 1244 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -162490,9 +166883,9 @@ var MultiFile = __webpack_require__(61);
* 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 AtlasJSONFile
@@ -162504,7 +166897,7 @@ var MultiFile = __webpack_require__(61);
* @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.
* @param {(string|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig)} 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 {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".
+ * @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.
*/
@@ -162585,7 +166978,7 @@ var AtlasJSONFile = new Class({
* Adds a JSON based Texture Atlas, or array of atlases, 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 ()
* {
@@ -162600,7 +166993,7 @@ var AtlasJSONFile = new Class({
* 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.
*
@@ -162608,7 +167001,7 @@ var AtlasJSONFile = new Class({
* These files are created by software such as Texture Packer, Shoebox and Adobe Flash / Animate.
* If you are using Texture Packer and have enabled multi-atlas support, then please use the Phaser Multi Atlas loader
* instead of this one.
- *
+ *
* 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.
@@ -162617,7 +167010,7 @@ var AtlasJSONFile = new Class({
* 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.atlas({
* key: 'mainmenu',
@@ -162631,7 +167024,7 @@ var AtlasJSONFile = new Class({
* Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead.
*
* Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:
- *
+ *
* ```javascript
* this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');
* // and later in your game ...
@@ -162652,13 +167045,13 @@ var AtlasJSONFile = new Class({
*
* 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.atlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.json');
* ```
*
* Or, if you are using a config object use the `normalMap` property:
- *
+ *
* ```javascript
* this.load.atlas({
* key: 'mainmenu',
@@ -162675,16 +167068,16 @@ var AtlasJSONFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#atlas
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig[])} 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 {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".
+ * @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 {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('atlas', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings)
{
@@ -162717,7 +167110,7 @@ module.exports = AtlasJSONFile;
/***/ }),
-/* 1225 */
+/* 1245 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -162732,14 +167125,14 @@ var GetFastValue = __webpack_require__(2);
var ImageFile = __webpack_require__(72);
var IsPlainObject = __webpack_require__(7);
var MultiFile = __webpack_require__(61);
-var XMLFile = __webpack_require__(213);
+var XMLFile = __webpack_require__(222);
/**
* @classdesc
* A single XML based Texture Atlas File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#atlasXML method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlasXML.
*
* @class AtlasXMLFile
@@ -162832,7 +167225,7 @@ var AtlasXMLFile = new Class({
* Adds an XML based Texture Atlas, or array of atlases, 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 ()
* {
@@ -162847,13 +167240,13 @@ var AtlasXMLFile = new Class({
* 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.
*
* Phaser expects the atlas data to be provided in an XML file format.
* These files are created by software such as Shoebox and Adobe Flash / Animate.
- *
+ *
* 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.
@@ -162862,7 +167255,7 @@ var AtlasXMLFile = new Class({
* 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.atlasXML({
* key: 'mainmenu',
@@ -162874,7 +167267,7 @@ var AtlasXMLFile = new Class({
* See the documentation for `Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig` for more details.
*
* Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:
- *
+ *
* ```javascript
* this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml');
* // and later in your game ...
@@ -162895,13 +167288,13 @@ var AtlasXMLFile = new Class({
*
* 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.atlasXML('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.xml');
* ```
*
* Or, if you are using a config object use the `normalMap` property:
- *
+ *
* ```javascript
* this.load.atlasXML({
* key: 'mainmenu',
@@ -162918,7 +167311,7 @@ var AtlasXMLFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#atlasXML
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.7.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -162927,7 +167320,7 @@ var AtlasXMLFile = new Class({
* @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 xml file. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('atlasXML', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings)
{
@@ -162960,7 +167353,7 @@ module.exports = AtlasXMLFile;
/***/ }),
-/* 1226 */
+/* 1246 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -162969,7 +167362,7 @@ module.exports = AtlasXMLFile;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var AudioFile = __webpack_require__(448);
+var AudioFile = __webpack_require__(457);
var Class = __webpack_require__(0);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -162982,7 +167375,7 @@ var MultiFile = __webpack_require__(61);
* An Audio Sprite File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#audioSprite method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audioSprite.
*
* @class AudioSpriteFile
@@ -163025,7 +167418,7 @@ var AudioSpriteFile = new Class({
if (!audioURL)
{
data = new JSONFile(loader, key, jsonURL, jsonXhrSettings);
-
+
MultiFile.call(this, loader, 'audiosprite', key, [ data ]);
this.config.resourceLoad = true;
@@ -163109,7 +167502,7 @@ var AudioSpriteFile = new Class({
* Adds a JSON based Audio Sprite, or array of audio sprites, 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 ()
* {
@@ -163120,13 +167513,13 @@ var AudioSpriteFile = new Class({
* ]);
* }
* ```
- *
+ *
* Audio Sprites are a combination of audio files and a JSON configuration.
* The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite
*
* If the JSON file includes a 'resource' object then you can let Phaser parse it and load the audio
* files automatically based on its content. To do this exclude the audio URLs from the load:
- *
+ *
* ```javascript
* function preload ()
* {
@@ -163141,7 +167534,7 @@ var AudioSpriteFile = new Class({
* 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.
*
@@ -163151,7 +167544,7 @@ var AudioSpriteFile = new Class({
* then remove it from the Audio Cache first, before loading a new one.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.audioSprite({
* key: 'kyobi',
@@ -163169,7 +167562,7 @@ var AudioSpriteFile = new Class({
* Instead of passing a URL for the audio JSON data you can also pass in a well formed JSON object instead.
*
* Once the audio has finished loading you can use it create an Audio Sprite by referencing its key:
- *
+ *
* ```javascript
* this.load.audioSprite('kyobi', 'kyobi.json');
* // and later in your game ...
@@ -163188,12 +167581,12 @@ var AudioSpriteFile = new Class({
* browser support.
*
* If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded.
- *
+ *
* Note: The ability to load this type of file will only be available if the Audio Sprite 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#audioSprite
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig[])} key - The key to use for this file, or a file configuration object, or an array of objects.
@@ -163203,7 +167596,7 @@ var AudioSpriteFile = new Class({
* @param {Phaser.Types.Loader.XHRSettingsObject} [audioXhrSettings] - An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings.
* @param {Phaser.Types.Loader.XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader.
+ * @return {this} The Loader.
*/
FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audioConfig, audioXhrSettings, jsonXhrSettings)
{
@@ -163250,7 +167643,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio
/***/ }),
-/* 1227 */
+/* 1247 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -163260,7 +167653,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -163271,7 +167664,7 @@ var IsPlainObject = __webpack_require__(7);
* A single Binary File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#binary method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#binary.
*
* @class BinaryFile
@@ -163345,7 +167738,7 @@ var BinaryFile = new Class({
* Adds a Binary file, or array of Binary 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 ()
* {
@@ -163360,14 +167753,14 @@ var BinaryFile = new Class({
* 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 Binary Cache upon a successful load.
* The key should be unique both in terms of files being loaded and files already present in the Binary 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 Binary Cache first, before loading a new one.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.binary({
* key: 'doom',
@@ -163379,7 +167772,7 @@ var BinaryFile = new Class({
* See the documentation for `Phaser.Types.Loader.FileTypes.BinaryFileConfig` for more details.
*
* Once the file has finished loading you can access it from its Cache using its key:
- *
+ *
* ```javascript
* this.load.binary('doom', 'files/Doom.wad');
* // and later in your game ...
@@ -163400,7 +167793,7 @@ var BinaryFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#binary
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.BinaryFileConfig|Phaser.Types.Loader.FileTypes.BinaryFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -163408,7 +167801,7 @@ var BinaryFile = new Class({
* @param {any} [dataType] - Optional type to cast the binary file to once loaded. For example, `Uint8Array`.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('binary', function (key, url, dataType, xhrSettings)
{
@@ -163432,7 +167825,7 @@ module.exports = BinaryFile;
/***/ }),
-/* 1228 */
+/* 1248 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -163447,15 +167840,15 @@ var GetFastValue = __webpack_require__(2);
var ImageFile = __webpack_require__(72);
var IsPlainObject = __webpack_require__(7);
var MultiFile = __webpack_require__(61);
-var ParseXMLBitmapFont = __webpack_require__(185);
-var XMLFile = __webpack_require__(213);
+var ParseXMLBitmapFont = __webpack_require__(193);
+var XMLFile = __webpack_require__(222);
/**
* @classdesc
* A single Bitmap Font based File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#bitmapFont method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#bitmapFont.
*
* @class BitmapFontFile
@@ -163536,7 +167929,11 @@ var BitmapFontFile = new Class({
image.addToCache();
xml.addToCache();
- this.loader.cacheManager.bitmapFont.add(image.key, { data: ParseXMLBitmapFont(xml.data), texture: image.key, frame: null });
+ var texture = image.cache.get(image.key);
+
+ var data = ParseXMLBitmapFont(xml.data, image.cache.getFrame(image.key), 0, 0, texture);
+
+ this.loader.cacheManager.bitmapFont.add(image.key, { data: data, texture: image.key, frame: null });
this.complete = true;
}
@@ -163563,14 +167960,14 @@ var BitmapFontFile = new Class({
* 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.
*
* Phaser expects the font data to be provided in an XML file format.
* These files are created by software such as the [Angelcode Bitmap Font Generator](http://www.angelcode.com/products/bmfont/),
* [Littera](http://kvazars.com/littera/) or [Glyph Designer](https://71squared.com/glyphdesigner)
- *
+ *
* 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.
@@ -163579,7 +167976,7 @@ var BitmapFontFile = new Class({
* 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.bitmapFont({
* key: 'goldenFont',
@@ -163591,7 +167988,7 @@ var BitmapFontFile = new Class({
* See the documentation for `Phaser.Types.Loader.FileTypes.BitmapFontFileConfig` for more details.
*
* Once the atlas has finished loading you can use key of it when creating a Bitmap Text Game Object:
- *
+ *
* ```javascript
* this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml');
* // and later in your game ...
@@ -163610,13 +168007,13 @@ var BitmapFontFile = new Class({
*
* 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.bitmapFont('goldenFont', [ 'images/GoldFont.png', 'images/GoldFont-n.png' ], 'images/GoldFont.xml');
* ```
*
* Or, if you are using a config object use the `normalMap` property:
- *
+ *
* ```javascript
* this.load.bitmapFont({
* key: 'goldenFont',
@@ -163633,7 +168030,7 @@ var BitmapFontFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#bitmapFont
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -163642,7 +168039,7 @@ var BitmapFontFile = new Class({
* @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings.
* @param {Phaser.Types.Loader.XHRSettingsObject} [fontDataXhrSettings] - An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('bitmapFont', function (key, textureURL, fontDataURL, textureXhrSettings, fontDataXhrSettings)
{
@@ -163675,7 +168072,7 @@ module.exports = BitmapFontFile;
/***/ }),
-/* 1229 */
+/* 1249 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -163685,7 +168082,7 @@ module.exports = BitmapFontFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -163696,7 +168093,7 @@ var IsPlainObject = __webpack_require__(7);
* A single CSS File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#css method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#css.
*
* @class CSSFile
@@ -163769,7 +168166,7 @@ var CSSFile = new Class({
* Adds a CSS file, or array of CSS 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 ()
* {
@@ -163784,11 +168181,11 @@ var CSSFile = new Class({
* 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 and not already in-use by another file in the Loader.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.css({
* key: 'headers',
@@ -163812,14 +168209,14 @@ var CSSFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#css
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.17.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.CSSFileConfig|Phaser.Types.Loader.FileTypes.CSSFileConfig[])} 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 `.css`, i.e. if `key` was "alien" then the URL will be "alien.css".
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('css', function (key, url, xhrSettings)
{
@@ -163843,7 +168240,7 @@ module.exports = CSSFile;
/***/ }),
-/* 1230 */
+/* 1250 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -163853,19 +168250,19 @@ module.exports = CSSFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
var IsPlainObject = __webpack_require__(7);
-var Shader = __webpack_require__(347);
+var Shader = __webpack_require__(353);
/**
* @classdesc
* A single GLSL File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#glsl method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#glsl.
*
* @class GLSLFile
@@ -164007,9 +168404,9 @@ var GLSLFile = new Class({
*
* @method Phaser.Loader.FileTypes.GLSLFile#getShaderName
* @since 3.17.0
- *
+ *
* @param {string[]} headerSource - The header data.
- *
+ *
* @return {string} The shader name.
*/
getShaderName: function (headerSource)
@@ -164032,9 +168429,9 @@ var GLSLFile = new Class({
*
* @method Phaser.Loader.FileTypes.GLSLFile#getShaderType
* @since 3.17.0
- *
+ *
* @param {string[]} headerSource - The header data.
- *
+ *
* @return {string} The shader type. Either 'fragment' or 'vertex'.
*/
getShaderType: function (headerSource)
@@ -164057,9 +168454,9 @@ var GLSLFile = new Class({
*
* @method Phaser.Loader.FileTypes.GLSLFile#getShaderUniforms
* @since 3.17.0
- *
+ *
* @param {string[]} headerSource - The header data.
- *
+ *
* @return {any} The shader uniforms object.
*/
getShaderUniforms: function (headerSource)
@@ -164099,10 +168496,10 @@ var GLSLFile = new Class({
* @method Phaser.Loader.FileTypes.GLSLFile#extractBlock
* @private
* @since 3.17.0
- *
+ *
* @param {string[]} data - The array of shader data to process.
* @param {integer} offset - The offset to start processing from.
- *
+ *
* @return {any} The processed shader block, or null.
*/
extractBlock: function (data, offset)
@@ -164167,7 +168564,7 @@ var GLSLFile = new Class({
* In Phaser 3 GLSL files are just plain Text files at the current moment in time.
*
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
- *
+ *
* ```javascript
* function preload ()
* {
@@ -164182,14 +168579,14 @@ var GLSLFile = new Class({
* 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 Shader Cache upon a successful load.
* The key should be unique both in terms of files being loaded and files already present in the Shader 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 Shader Cache first, before loading a new one.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.glsl({
* key: 'plasma',
@@ -164201,7 +168598,7 @@ var GLSLFile = new Class({
* See the documentation for `Phaser.Types.Loader.FileTypes.GLSLFileConfig` for more details.
*
* Once the file has finished loading you can access it from its Cache using its key:
- *
+ *
* ```javascript
* this.load.glsl('plasma', 'shaders/Plasma.glsl');
* // and later in your game ...
@@ -164222,7 +168619,7 @@ var GLSLFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#glsl
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.GLSLFileConfig|Phaser.Types.Loader.FileTypes.GLSLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -164230,7 +168627,7 @@ var GLSLFile = new Class({
* @param {string} [shaderType='fragment'] - The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('glsl', function (key, url, shaderType, xhrSettings)
{
@@ -164254,7 +168651,7 @@ module.exports = GLSLFile;
/***/ }),
-/* 1231 */
+/* 1251 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -164264,7 +168661,7 @@ module.exports = GLSLFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -164398,14 +168795,14 @@ var HTMLFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#html
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.12.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.HTMLFileConfig|Phaser.Types.Loader.FileTypes.HTMLFileConfig[])} 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 {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('html', function (key, url, xhrSettings)
{
@@ -164429,7 +168826,7 @@ module.exports = HTMLFile;
/***/ }),
-/* 1232 */
+/* 1252 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -164439,7 +168836,7 @@ module.exports = HTMLFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -164450,7 +168847,7 @@ var IsPlainObject = __webpack_require__(7);
* A single HTML File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#htmlTexture method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#htmlTexture.
*
* @class HTMLTextureFile
@@ -164589,7 +168986,7 @@ var HTMLTextureFile = new Class({
* will be rendered to textures and stored in the Texture Manager.
*
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
- *
+ *
* ```javascript
* function preload ()
* {
@@ -164611,7 +169008,7 @@ var HTMLTextureFile = new Class({
* 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.htmlTexture({
* key: 'instructions',
@@ -164624,7 +169021,7 @@ var HTMLTextureFile = new Class({
* See the documentation for `Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig` 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.htmlTexture('instructions', 'content/intro.html', 256, 512);
* // and later in your game ...
@@ -164654,7 +169051,7 @@ var HTMLTextureFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#htmlTexture
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.12.0
*
* @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.
@@ -164663,7 +169060,7 @@ var HTMLTextureFile = new Class({
* @param {integer} [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 {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('htmlTexture', function (key, url, width, height, xhrSettings)
{
@@ -164687,7 +169084,7 @@ module.exports = HTMLTextureFile;
/***/ }),
-/* 1233 */
+/* 1253 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -164709,7 +169106,7 @@ var MultiFile = __webpack_require__(61);
* A single Multi Texture Atlas File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#multiatlas method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#multiatlas.
*
* @class MultiAtlasFile
@@ -164875,7 +169272,7 @@ var MultiAtlasFile = new Class({
if (item.image === key)
{
images.push(image);
-
+
data.push(item);
if (file.linkFile)
@@ -164910,7 +169307,7 @@ var MultiAtlasFile = new Class({
* Adds a Multi Texture Atlas, or array of multi atlases, 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 ()
* {
@@ -164925,7 +169322,7 @@ var MultiAtlasFile = new Class({
* 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.
*
@@ -164935,14 +169332,14 @@ var MultiAtlasFile = new Class({
* The way it works internally is that you provide a URL to the JSON file. Phaser then loads this JSON, parses it and
* extracts which texture files it also needs to load to complete the process. If the JSON also defines normal maps,
* Phaser will load those as well.
- *
+ *
* 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.multiatlas({
* key: 'level1',
@@ -164955,7 +169352,7 @@ var MultiAtlasFile = new Class({
* Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead.
*
* Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:
- *
+ *
* ```javascript
* this.load.multiatlas('level1', 'images/Level1.json');
* // and later in your game ...
@@ -164978,7 +169375,7 @@ var MultiAtlasFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#multiatlas
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.7.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig|Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -164987,7 +169384,7 @@ var MultiAtlasFile = new Class({
* @param {string} [baseURL] - Optional Base URL to use when loading the textures defined in the atlas data.
* @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 {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('multiatlas', function (key, atlasURL, path, baseURL, atlasXhrSettings)
{
@@ -165020,7 +169417,7 @@ module.exports = MultiAtlasFile;
/***/ }),
-/* 1234 */
+/* 1254 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -165034,14 +169431,14 @@ var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
var IsPlainObject = __webpack_require__(7);
var MultiFile = __webpack_require__(61);
-var ScriptFile = __webpack_require__(450);
+var ScriptFile = __webpack_require__(459);
/**
* @classdesc
* A Multi Script File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#scripts method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scripts.
*
* @class MultiScriptFile
@@ -165121,7 +169518,7 @@ var MultiScriptFile = new Class({
file.data.type = 'text/javascript';
file.data.defer = false;
file.data.text = file.xhrLoader.responseText;
-
+
document.head.appendChild(file.data);
}
@@ -165133,13 +169530,13 @@ var MultiScriptFile = new Class({
/**
* Adds an array of Script files to the current load queue.
- *
+ *
* The difference between this and the `ScriptFile` file type is that you give an array of scripts to this method,
* and the scripts are then processed _exactly_ in that order. This allows you to load a bunch of scripts that
* may have dependencies on each other without worrying about the async nature of traditional script loading.
*
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
- *
+ *
* ```javascript
* function preload ()
* {
@@ -165153,7 +169550,7 @@ var MultiScriptFile = new Class({
* ]);
* }
* ```
- *
+ *
* In the code above the script files will all be loaded in parallel but only processed (i.e. invoked) in the exact
* order given in the array.
*
@@ -165164,11 +169561,11 @@ var MultiScriptFile = new Class({
* 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 and not already in-use by another file in the Loader.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.scripts({
* key: 'PostProcess',
@@ -165196,7 +169593,7 @@ var MultiScriptFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#scripts
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.17.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -165204,7 +169601,7 @@ var MultiScriptFile = new Class({
* @param {string} [extension='js'] - The default file extension to use if no url is provided.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for these files.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('scripts', function (key, url, xhrSettings)
{
@@ -165237,7 +169634,7 @@ module.exports = MultiScriptFile;
/***/ }),
-/* 1235 */
+/* 1255 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -165247,7 +169644,7 @@ module.exports = MultiScriptFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var FileTypesManager = __webpack_require__(8);
var JSONFile = __webpack_require__(60);
@@ -165256,7 +169653,7 @@ var JSONFile = __webpack_require__(60);
* A single JSON Pack File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#pack method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#pack.
*
* @class PackFile
@@ -165315,7 +169712,7 @@ var PackFile = new Class({
* Adds a JSON File Pack, or array of packs, 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 ()
* {
@@ -165327,7 +169724,7 @@ var PackFile = new Class({
* Here is a small example:
*
* ```json
- * {
+ * {
* "test1": {
* "files": [
* {
@@ -165368,17 +169765,17 @@ var PackFile = new Class({
* 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.
- *
+ *
* 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.pack({
* key: 'level1',
@@ -165400,7 +169797,7 @@ var PackFile = new Class({
*
* 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": {
@@ -165420,7 +169817,7 @@ var PackFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#pack
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.7.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.PackFileConfig|Phaser.Types.Loader.FileTypes.PackFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -165428,7 +169825,7 @@ var PackFile = new Class({
* @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 {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('pack', function (key, url, packKey, xhrSettings)
{
@@ -165455,7 +169852,7 @@ module.exports = PackFile;
/***/ }),
-/* 1236 */
+/* 1256 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -165465,7 +169862,7 @@ module.exports = PackFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -165476,7 +169873,7 @@ var IsPlainObject = __webpack_require__(7);
* A single Plugin Script File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#plugin method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#plugin.
*
* @class PluginFile
@@ -165590,7 +169987,7 @@ var PluginFile = new Class({
* Adds a Plugin Script file, or array of plugin 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 ()
* {
@@ -165605,11 +170002,11 @@ var PluginFile = new Class({
* 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 and not already in-use by another file in the Loader.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.plugin({
* key: 'modplayer',
@@ -165634,7 +170031,7 @@ var PluginFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#plugin
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.PluginFileConfig|Phaser.Types.Loader.FileTypes.PluginFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -165643,7 +170040,7 @@ var PluginFile = new Class({
* @param {string} [mapping] - If this plugin is to be injected into the Scene, this is the property key used.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('plugin', function (key, url, start, mapping, xhrSettings)
{
@@ -165667,7 +170064,7 @@ module.exports = PluginFile;
/***/ }),
-/* 1237 */
+/* 1257 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -165677,7 +170074,7 @@ module.exports = PluginFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -165792,34 +170189,34 @@ var SceneFile = new Class({
* loaded.
*
* The key must be a unique String. It is used to add the file to the global Scene Manager upon a successful load.
- *
+ *
* For a Scene File it's vitally important that the key matches the class name in the JavaScript file.
- *
+ *
* For example here is the source file:
- *
+ *
* ```javascript
* class ExternalScene extends Phaser.Scene {
- *
+ *
* constructor ()
* {
* super('myScene');
* }
- *
+ *
* }
* ```
- *
+ *
* Because the class is called `ExternalScene` that is the exact same key you must use when loading it:
- *
+ *
* ```javascript
* function preload ()
* {
* this.load.sceneFile('ExternalScene', 'src/yourScene.js');
* }
* ```
- *
+ *
* The key that is used within the Scene Manager can either be set to the same, or you can override it in the Scene
* constructor, as we've done in the example above, where the Scene key was changed to `myScene`.
- *
+ *
* The key should be unique both in terms of files being loaded and Scenes already present in the Scene 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 Scene Manager first, before loading a new one.
@@ -165857,14 +170254,14 @@ var SceneFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#sceneFile
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.16.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.SceneFileConfig|Phaser.Types.Loader.FileTypes.SceneFileConfig[])} 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 `.js`, i.e. if `key` was "alien" then the URL will be "alien.js".
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('sceneFile', function (key, url, xhrSettings)
{
@@ -165888,7 +170285,7 @@ module.exports = SceneFile;
/***/ }),
-/* 1238 */
+/* 1258 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -165898,7 +170295,7 @@ module.exports = SceneFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -165909,7 +170306,7 @@ var IsPlainObject = __webpack_require__(7);
* A single Scene Plugin Script File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#scenePlugin method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scenePlugin.
*
* @class ScenePluginFile
@@ -166017,7 +170414,7 @@ var ScenePluginFile = new Class({
* Adds a Scene Plugin Script file, or array of plugin 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 ()
* {
@@ -166032,11 +170429,11 @@ var ScenePluginFile = new Class({
* 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 and not already in-use by another file in the Loader.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.scenePlugin({
* key: 'modplayer',
@@ -166061,7 +170458,7 @@ var ScenePluginFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#scenePlugin
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.8.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -166070,7 +170467,7 @@ var ScenePluginFile = new Class({
* @param {string} [sceneKey] - If this plugin is to be added to the Scene, this is the property key for it.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('scenePlugin', function (key, url, systemKey, sceneKey, xhrSettings)
{
@@ -166094,7 +170491,7 @@ module.exports = ScenePluginFile;
/***/ }),
-/* 1239 */
+/* 1259 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -166253,7 +170650,7 @@ var SpriteSheetFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#spritesheet
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -166261,7 +170658,7 @@ var SpriteSheetFile = new Class({
* @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. At a minimum it should have a `frameWidth` property.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('spritesheet', function (key, url, frameConfig, xhrSettings)
{
@@ -166285,7 +170682,7 @@ module.exports = SpriteSheetFile;
/***/ }),
-/* 1240 */
+/* 1260 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -166295,7 +170692,7 @@ module.exports = SpriteSheetFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
@@ -166538,21 +170935,21 @@ var SVGFile = new Class({
* 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.html". It will always add `.html` 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 optionally pass an SVG Resize Configuration object when you load an SVG file. By default the SVG will be rendered to a texture
* at the same size defined in the SVG file attributes. However, this isn't always desirable. You may wish to resize the SVG (either down
* or up) to improve texture clarity, or reduce texture memory consumption. You can either specify an exact width and height to resize
* the SVG to:
- *
+ *
* ```javascript
* function preload ()
* {
* this.load.svg('morty', 'images/Morty.svg', { width: 300, height: 600 });
* }
* ```
- *
+ *
* Or when using a configuration object:
- *
+ *
* ```javascript
* this.load.svg({
* key: 'morty',
@@ -166563,18 +170960,18 @@ var SVGFile = new Class({
* }
* });
* ```
- *
+ *
* Alternatively, you can just provide a scale factor instead:
- *
+ *
* ```javascript
* function preload ()
* {
* this.load.svg('morty', 'images/Morty.svg', { scale: 2.5 });
* }
* ```
- *
+ *
* Or when using a configuration object:
- *
+ *
* ```javascript
* this.load.svg({
* key: 'morty',
@@ -166584,14 +170981,14 @@ var SVGFile = new Class({
* }
* });
* ```
- *
+ *
* If scale, width and height values are all given, the scale has priority and the width and height values are ignored.
*
* Note: The ability to load this type of file will only be available if the SVG 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#svg
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.SVGFileConfig|Phaser.Types.Loader.FileTypes.SVGFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -166599,7 +170996,7 @@ var SVGFile = new Class({
* @param {Phaser.Types.Loader.FileTypes.SVGSizeConfig} [svgConfig] - The svg size configuration object.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('svg', function (key, url, svgConfig, xhrSettings)
{
@@ -166624,7 +171021,7 @@ module.exports = SVGFile;
/***/ }),
-/* 1241 */
+/* 1261 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -166634,12 +171031,12 @@ module.exports = SVGFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
var IsPlainObject = __webpack_require__(7);
-var TILEMAP_FORMATS = __webpack_require__(31);
+var TILEMAP_FORMATS = __webpack_require__(32);
/**
* @classdesc
@@ -166788,14 +171185,14 @@ var TilemapCSVFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#tilemapCSV
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig[])} 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 `.csv`, i.e. if `key` was "alien" then the URL will be "alien.csv".
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('tilemapCSV', function (key, url, xhrSettings)
{
@@ -166819,7 +171216,7 @@ module.exports = TilemapCSVFile;
/***/ }),
-/* 1242 */
+/* 1262 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -166831,7 +171228,7 @@ module.exports = TilemapCSVFile;
var Class = __webpack_require__(0);
var FileTypesManager = __webpack_require__(8);
var JSONFile = __webpack_require__(60);
-var TILEMAP_FORMATS = __webpack_require__(31);
+var TILEMAP_FORMATS = __webpack_require__(32);
/**
* @classdesc
@@ -166944,14 +171341,14 @@ var TilemapImpactFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#tilemapImpact
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.7.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig[])} 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 `.json`, i.e. if `key` was "alien" then the URL will be "alien.json".
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('tilemapImpact', function (key, url, xhrSettings)
{
@@ -166975,7 +171372,7 @@ module.exports = TilemapImpactFile;
/***/ }),
-/* 1243 */
+/* 1263 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -166987,7 +171384,7 @@ module.exports = TilemapImpactFile;
var Class = __webpack_require__(0);
var FileTypesManager = __webpack_require__(8);
var JSONFile = __webpack_require__(60);
-var TILEMAP_FORMATS = __webpack_require__(31);
+var TILEMAP_FORMATS = __webpack_require__(32);
/**
* @classdesc
@@ -167005,7 +171402,7 @@ var TILEMAP_FORMATS = __webpack_require__(31);
*
* @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.
* @param {(string|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig)} 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 `.json`, i.e. if `key` was "alien" then the URL will be "alien.json".
+ * @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, a well formed JSON object.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.
*/
var TilemapJSONFile = new Class({
@@ -167100,14 +171497,14 @@ var TilemapJSONFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#tilemapTiledJSON
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig[])} 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 `.json`, i.e. if `key` was "alien" then the URL will be "alien.json".
+ * @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, a well formed JSON object.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('tilemapTiledJSON', function (key, url, xhrSettings)
{
@@ -167131,7 +171528,7 @@ module.exports = TilemapJSONFile;
/***/ }),
-/* 1244 */
+/* 1264 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -167146,14 +171543,14 @@ var GetFastValue = __webpack_require__(2);
var ImageFile = __webpack_require__(72);
var IsPlainObject = __webpack_require__(7);
var MultiFile = __webpack_require__(61);
-var TextFile = __webpack_require__(451);
+var TextFile = __webpack_require__(460);
/**
* @classdesc
* A single text file based Unity Texture Atlas File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#unityAtlas method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#unityAtlas.
*
* @class UnityAtlasFile
@@ -167246,7 +171643,7 @@ var UnityAtlasFile = new Class({
* Adds a Unity YAML based Texture Atlas, or array of atlases, 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 ()
* {
@@ -167261,12 +171658,12 @@ var UnityAtlasFile = new Class({
* 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.
*
* Phaser expects the atlas data to be provided in a YAML formatted text file as exported from Unity.
- *
+ *
* 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.
@@ -167275,7 +171672,7 @@ var UnityAtlasFile = new Class({
* 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.unityAtlas({
* key: 'mainmenu',
@@ -167287,7 +171684,7 @@ var UnityAtlasFile = new Class({
* See the documentation for `Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig` for more details.
*
* Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:
- *
+ *
* ```javascript
* this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');
* // and later in your game ...
@@ -167308,13 +171705,13 @@ var UnityAtlasFile = new Class({
*
* 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.unityAtlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.txt');
* ```
*
* Or, if you are using a config object use the `normalMap` property:
- *
+ *
* ```javascript
* this.load.unityAtlas({
* key: 'mainmenu',
@@ -167331,7 +171728,7 @@ var UnityAtlasFile = new Class({
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#unityAtlas
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.0.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -167340,7 +171737,7 @@ var UnityAtlasFile = new Class({
* @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 data file. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('unityAtlas', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings)
{
@@ -167373,7 +171770,7 @@ module.exports = UnityAtlasFile;
/***/ }),
-/* 1245 */
+/* 1265 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -167383,10 +171780,10 @@ module.exports = UnityAtlasFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(29);
+var CONST = __webpack_require__(18);
var File = __webpack_require__(21);
var FileTypesManager = __webpack_require__(8);
-var GetURL = __webpack_require__(134);
+var GetURL = __webpack_require__(140);
var GetFastValue = __webpack_require__(2);
var IsPlainObject = __webpack_require__(7);
@@ -167395,7 +171792,7 @@ var IsPlainObject = __webpack_require__(7);
* A single Video File suitable for loading by the Loader.
*
* These are created when you use the Phaser.Loader.LoaderPlugin#video method and are not typically created directly.
- *
+ *
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#video.
*
* @class VideoFile
@@ -167500,13 +171897,13 @@ var VideoFile = new Class({
* @method Phaser.Loader.FileTypes.VideoFile#createVideoElement
* @private
* @since 3.20.0
- *
+ *
* @return {HTMLVideoElement} The newly created Video element.
*/
createVideoElement: function ()
{
var video = document.createElement('video');
-
+
video.controls = false;
video.crossOrigin = this.loader.crossOrigin;
@@ -167639,7 +172036,10 @@ VideoFile.getVideoURL = function (game, urls)
if (url.indexOf('blob:') === 0)
{
- return url;
+ return {
+ url: url,
+ type: ''
+ };
}
var videoType;
@@ -167671,7 +172071,7 @@ VideoFile.getVideoURL = function (game, urls)
* Adds a Video file, or array of video 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 ()
* {
@@ -167686,14 +172086,14 @@ VideoFile.getVideoURL = function (game, urls)
* 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 Video Cache upon a successful load.
* The key should be unique both in terms of files being loaded and files already present in the Video 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 Video Cache first, before loading a new one.
*
* Instead of passing arguments you can pass a configuration object, such as:
- *
+ *
* ```javascript
* this.load.video({
* key: 'intro',
@@ -167710,7 +172110,7 @@ VideoFile.getVideoURL = function (game, urls)
* Due to different browsers supporting different video file types you should usually provide your video files in a variety of formats.
* mp4, mov and webm are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on
* browser support, starting with the first in the array and progressing to the end.
- *
+ *
* Unlike most asset-types, videos do not _need_ to be preloaded. You can create a Video Game Object and then call its `loadURL` method,
* to load a video at run-time, rather than in advance.
*
@@ -167718,7 +172118,7 @@ VideoFile.getVideoURL = function (game, urls)
* It is available in the default build but can be excluded from custom builds.
*
* @method Phaser.Loader.LoaderPlugin#video
- * @fires Phaser.Loader.LoaderPlugin#addFileEvent
+ * @fires Phaser.Loader.LoaderPlugin#ADD
* @since 3.20.0
*
* @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig|Phaser.Types.Loader.FileTypes.VideoFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
@@ -167728,7 +172128,7 @@ VideoFile.getVideoURL = function (game, urls)
* @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it.
* @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
*
- * @return {Phaser.Loader.LoaderPlugin} The Loader instance.
+ * @return {this} The Loader instance.
*/
FileTypesManager.register('video', function (key, urls, loadEvent, asBlob, noAudio, xhrSettings)
{
@@ -167764,7 +172164,7 @@ module.exports = VideoFile;
/***/ }),
-/* 1246 */
+/* 1266 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -167774,15 +172174,15 @@ module.exports = VideoFile;
*/
var Class = __webpack_require__(0);
-var CONST = __webpack_require__(20);
-var CustomSet = __webpack_require__(108);
-var EventEmitter = __webpack_require__(9);
-var Events = __webpack_require__(81);
+var CONST = __webpack_require__(18);
+var CustomSet = __webpack_require__(135);
+var EventEmitter = __webpack_require__(11);
+var Events = __webpack_require__(82);
var FileTypesManager = __webpack_require__(8);
var GetFastValue = __webpack_require__(2);
var PluginCache = __webpack_require__(23);
-var SceneEvents = __webpack_require__(19);
-var XHRSettings = __webpack_require__(135);
+var SceneEvents = __webpack_require__(22);
+var XHRSettings = __webpack_require__(141);
/**
* @classdesc
@@ -167920,9 +172320,9 @@ var LoaderPlugin = new Class({
/**
* If you want to append a URL before the path of any asset you can set this here.
- *
+ *
* Useful if allowing the asset base url to be configured outside of the game code.
- *
+ *
* If you set this property directly then it _must_ end with a "/". Alternatively, call `setBaseURL()` and it'll do it for you.
*
* @name Phaser.Loader.LoaderPlugin#baseURL
@@ -167963,7 +172363,8 @@ var LoaderPlugin = new Class({
GetFastValue(sceneConfig, 'async', gameConfig.loaderAsync),
GetFastValue(sceneConfig, 'user', gameConfig.loaderUser),
GetFastValue(sceneConfig, 'password', gameConfig.loaderPassword),
- GetFastValue(sceneConfig, 'timeout', gameConfig.loaderTimeout)
+ GetFastValue(sceneConfig, 'timeout', gameConfig.loaderTimeout),
+ GetFastValue(sceneConfig, 'withCredentials', gameConfig.loaderWithCredentials)
);
/**
@@ -168000,7 +172401,7 @@ var LoaderPlugin = new Class({
/**
* Files are placed in this Set when they're added to the Loader via `addFile`.
- *
+ *
* They are moved to the `inflight` Set when they start loading, and assuming a successful
* load, to the `queue` Set for further processing.
*
@@ -168014,9 +172415,9 @@ var LoaderPlugin = new Class({
/**
* Files are stored in this Set while they're in the process of being loaded.
- *
+ *
* Upon a successful load they are moved to the `queue` Set.
- *
+ *
* By the end of the load process this Set will be empty.
*
* @name Phaser.Loader.LoaderPlugin#inflight
@@ -168027,10 +172428,10 @@ var LoaderPlugin = new Class({
/**
* Files are stored in this Set while they're being processed.
- *
+ *
* If the process is successful they are moved to their final destination, which could be
* a Cache or the Texture Manager.
- *
+ *
* At the end of the load process this Set will be empty.
*
* @name Phaser.Loader.LoaderPlugin#queue
@@ -168125,9 +172526,9 @@ var LoaderPlugin = new Class({
/**
* If you want to append a URL before the path of any asset you can set this here.
- *
+ *
* Useful if allowing the asset base url to be configured outside of the game code.
- *
+ *
* Once a base URL is set it will affect every file loaded by the Loader from that point on. It does _not_ change any
* file _already_ being loaded. To reset it, call this method with no arguments.
*
@@ -168136,7 +172537,7 @@ var LoaderPlugin = new Class({
*
* @param {string} [url] - The URL to use. Leave empty to reset.
*
- * @return {Phaser.Loader.LoaderPlugin} This Loader object.
+ * @return {this} This Loader object.
*/
setBaseURL: function (url)
{
@@ -168167,7 +172568,7 @@ var LoaderPlugin = new Class({
* given as it's an absolute URL.
*
* Please note that the path is added before the filename but *after* the baseURL (if set.)
- *
+ *
* Once a path is set it will then affect every file added to the Loader from that point on. It does _not_ change any
* file _already_ in the load queue. To reset it, call this method with no arguments.
*
@@ -168176,7 +172577,7 @@ var LoaderPlugin = new Class({
*
* @param {string} [path] - The path to use. Leave empty to reset.
*
- * @return {Phaser.Loader.LoaderPlugin} This Loader object.
+ * @return {this} This Loader object.
*/
setPath: function (path)
{
@@ -168194,9 +172595,9 @@ var LoaderPlugin = new Class({
/**
* An optional prefix that is automatically prepended to the start of every file key.
- *
+ *
* If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`.
- *
+ *
* Once a prefix is set it will then affect every file added to the Loader from that point on. It does _not_ change any
* file _already_ in the load queue. To reset it, call this method with no arguments.
*
@@ -168205,7 +172606,7 @@ var LoaderPlugin = new Class({
*
* @param {string} [prefix] - The prefix to use. Leave empty to reset.
*
- * @return {Phaser.Loader.LoaderPlugin} This Loader object.
+ * @return {this} This Loader object.
*/
setPrefix: function (prefix)
{
@@ -168218,9 +172619,9 @@ var LoaderPlugin = new Class({
/**
* Sets the Cross Origin Resource Sharing value used when loading files.
- *
+ *
* Files can override this value on a per-file basis by specifying an alternative `crossOrigin` value in their file config.
- *
+ *
* Once CORs is set it will then affect every file loaded by the Loader from that point on, as long as they don't have
* their own CORs setting. To reset it, call this method with no arguments.
*
@@ -168231,7 +172632,7 @@ var LoaderPlugin = new Class({
*
* @param {string} [crossOrigin] - The value to use for the `crossOrigin` property in the load request.
*
- * @return {Phaser.Loader.LoaderPlugin} This Loader object.
+ * @return {this} This Loader object.
*/
setCORS: function (crossOrigin)
{
@@ -168354,7 +172755,7 @@ var LoaderPlugin = new Class({
* @method Phaser.Loader.LoaderPlugin#addPack
* @since 3.7.0
*
- * @param {any} data - The Pack File data to be parsed and each entry of it to added to the load queue.
+ * @param {any} pack - The Pack File data to be parsed and each entry of it to added to the load queue.
* @param {string} [packKey] - An optional key to use from the pack file data.
*
* @return {boolean} `true` if any files were added to the queue, otherwise `false`.
@@ -168377,6 +172778,11 @@ var LoaderPlugin = new Class({
// Here we go ...
for (var key in pack)
{
+ if (!Object.prototype.hasOwnProperty.call(pack, key))
+ {
+ continue;
+ }
+
var config = pack[key];
// Any meta data to process?
@@ -168521,10 +172927,10 @@ var LoaderPlugin = new Class({
/**
* An internal method called by the Loader.
- *
+ *
* It will check to see if there are any more files in the pending list that need loading, and if so it will move
* them from the list Set into the inflight Set, set their CORs flag and start them loading.
- *
+ *
* It will carrying on doing this for each file in the pending list until it runs out, or hits the max allowed parallel downloads.
*
* @method Phaser.Loader.LoaderPlugin#checkLoadQueue
@@ -168561,7 +172967,7 @@ var LoaderPlugin = new Class({
/**
* An internal method called automatically by the XHRLoader belong to a File.
- *
+ *
* This method will remove the given file from the inflight Set and update the load progress.
* If the file was successful its `onProcess` method is called, otherwise it is added to the delete queue.
*
@@ -168701,7 +173107,7 @@ var LoaderPlugin = new Class({
*
* @method Phaser.Loader.LoaderPlugin#flagForRemoval
* @since 3.7.0
- *
+ *
* @param {Phaser.Loader.File} file - The File to be queued for deletion when the Loader completes.
*/
flagForRemoval: function (file)
@@ -168720,7 +173126,7 @@ var LoaderPlugin = new Class({
* @param {*} data - The JSON data, ready parsed.
* @param {string} [filename=file.json] - The name to save the JSON file as.
*
- * @return {Phaser.Loader.LoaderPlugin} This Loader plugin.
+ * @return {this} This Loader plugin.
*/
saveJSON: function (data, filename)
{
@@ -168729,7 +173135,7 @@ var LoaderPlugin = new Class({
/**
* Causes the browser to save the given data as a file to its default Downloads folder.
- *
+ *
* Creates a DOM level anchor link, assigns it as being a `download` anchor, sets the href
* to be an ObjectURL based on the given data, and then invokes a click event.
*
@@ -168740,7 +173146,7 @@ var LoaderPlugin = new Class({
* @param {string} [filename=file.json] - The filename to save the file as.
* @param {string} [filetype=application/json] - The file type to use when saving the file. Defaults to JSON.
*
- * @return {Phaser.Loader.LoaderPlugin} This Loader plugin.
+ * @return {this} This Loader plugin.
*/
save: function (data, filename, filetype)
{
@@ -168841,7 +173247,7 @@ module.exports = LoaderPlugin;
/***/ }),
-/* 1247 */
+/* 1267 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -168850,15 +173256,8 @@ module.exports = LoaderPlugin;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CONST = __webpack_require__(50);
-var Extend = __webpack_require__(17);
-
-/**
- * @callback ArcadePhysicsCallback
- *
- * @param {Phaser.GameObjects.GameObject} object1 - The first Body to separate.
- * @param {Phaser.GameObjects.GameObject} object2 - The second Body to separate.
- */
+var CONST = __webpack_require__(51);
+var Extend = __webpack_require__(19);
/**
* @namespace Phaser.Physics.Arcade
@@ -168866,18 +173265,18 @@ var Extend = __webpack_require__(17);
var Arcade = {
- ArcadePhysics: __webpack_require__(1248),
- Body: __webpack_require__(458),
- Collider: __webpack_require__(459),
- Components: __webpack_require__(214),
- Events: __webpack_require__(215),
- Factory: __webpack_require__(452),
- Group: __webpack_require__(454),
- Image: __webpack_require__(453),
- Sprite: __webpack_require__(136),
- StaticBody: __webpack_require__(464),
- StaticGroup: __webpack_require__(455),
- World: __webpack_require__(457)
+ ArcadePhysics: __webpack_require__(1268),
+ Body: __webpack_require__(467),
+ Collider: __webpack_require__(468),
+ Components: __webpack_require__(223),
+ Events: __webpack_require__(224),
+ Factory: __webpack_require__(461),
+ Group: __webpack_require__(463),
+ Image: __webpack_require__(462),
+ Sprite: __webpack_require__(142),
+ StaticBody: __webpack_require__(473),
+ StaticGroup: __webpack_require__(464),
+ World: __webpack_require__(466)
};
@@ -168888,7 +173287,7 @@ module.exports = Arcade;
/***/ }),
-/* 1248 */
+/* 1268 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -168898,18 +173297,18 @@ module.exports = Arcade;
*/
var Class = __webpack_require__(0);
-var DegToRad = __webpack_require__(35);
-var DistanceBetween = __webpack_require__(53);
-var DistanceSquared = __webpack_require__(316);
-var Factory = __webpack_require__(452);
+var DegToRad = __webpack_require__(39);
+var DistanceBetween = __webpack_require__(54);
+var DistanceSquared = __webpack_require__(325);
+var Factory = __webpack_require__(461);
var GetFastValue = __webpack_require__(2);
-var Merge = __webpack_require__(107);
-var OverlapCirc = __webpack_require__(1261);
-var OverlapRect = __webpack_require__(456);
+var Merge = __webpack_require__(128);
+var OverlapCirc = __webpack_require__(1281);
+var OverlapRect = __webpack_require__(465);
var PluginCache = __webpack_require__(23);
-var SceneEvents = __webpack_require__(19);
+var SceneEvents = __webpack_require__(22);
var Vector2 = __webpack_require__(3);
-var World = __webpack_require__(457);
+var World = __webpack_require__(466);
/**
* @classdesc
@@ -169577,7 +173976,7 @@ module.exports = ArcadePhysics;
/***/ }),
-/* 1249 */
+/* 1269 */
/***/ (function(module, exports) {
/**
@@ -169652,7 +174051,7 @@ module.exports = Acceleration;
/***/ }),
-/* 1250 */
+/* 1270 */
/***/ (function(module, exports) {
/**
@@ -169734,7 +174133,7 @@ module.exports = Angular;
/***/ }),
-/* 1251 */
+/* 1271 */
/***/ (function(module, exports) {
/**
@@ -169833,7 +174232,7 @@ module.exports = Bounce;
/***/ }),
-/* 1252 */
+/* 1272 */
/***/ (function(module, exports) {
/**
@@ -169960,7 +174359,7 @@ module.exports = Debug;
/***/ }),
-/* 1253 */
+/* 1273 */
/***/ (function(module, exports) {
/**
@@ -170093,7 +174492,7 @@ module.exports = Drag;
/***/ }),
-/* 1254 */
+/* 1274 */
/***/ (function(module, exports) {
/**
@@ -170217,7 +174616,7 @@ module.exports = Enable;
/***/ }),
-/* 1255 */
+/* 1275 */
/***/ (function(module, exports) {
/**
@@ -170227,24 +174626,30 @@ module.exports = Enable;
*/
/**
- * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. The higher than friction, the faster the body will slow down once force stops being applied to it.
+ * Methods for setting the friction of an Arcade Physics Body.
+ *
+ * In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body.
*
* @namespace Phaser.Physics.Arcade.Components.Friction
* @since 3.0.0
+ *
+ * @see Phaser.Physics.Arcade.Body#friction
*/
var Friction = {
/**
- * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving.
- * The higher than friction, the faster the body will slow down once force stops being applied to it.
+ * Sets the friction of this game object's physics body.
+ * In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body.
*
* @method Phaser.Physics.Arcade.Components.Friction#setFriction
* @since 3.0.0
*
- * @param {number} x - The amount of horizontal friction to apply.
- * @param {number} [y=x] - The amount of vertical friction to apply.
+ * @param {number} x - The amount of horizontal friction to apply, [0, 1].
+ * @param {number} [y=x] - The amount of vertical friction to apply, [0, 1].
*
* @return {this} This Game Object.
+ *
+ * @see Phaser.Physics.Arcade.Body#friction
*/
setFriction: function (x, y)
{
@@ -170254,15 +174659,17 @@ var Friction = {
},
/**
- * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis.
- * The higher than friction, the faster the body will slow down once force stops being applied to it.
+ * Sets the horizontal friction of this game object's physics body.
+ * This can move a riding body horizontally when it collides with this one on the vertical axis.
*
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionX
* @since 3.0.0
*
- * @param {number} x - The amount of friction to apply.
+ * @param {number} x - The amount of friction to apply, [0, 1].
*
* @return {this} This Game Object.
+ *
+ * @see Phaser.Physics.Arcade.Body#friction
*/
setFrictionX: function (x)
{
@@ -170272,15 +174679,17 @@ var Friction = {
},
/**
- * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis.
- * The higher than friction, the faster the body will slow down once force stops being applied to it.
+ * Sets the vertical friction of this game object's physics body.
+ * This can move a riding body vertically when it collides with this one on the horizontal axis.
*
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionY
* @since 3.0.0
*
- * @param {number} x - The amount of friction to apply.
+ * @param {number} y - The amount of friction to apply, [0, 1].
*
* @return {this} This Game Object.
+ *
+ * @see Phaser.Physics.Arcade.Body#friction
*/
setFrictionY: function (y)
{
@@ -170295,7 +174704,7 @@ module.exports = Friction;
/***/ }),
-/* 1256 */
+/* 1276 */
/***/ (function(module, exports) {
/**
@@ -170373,7 +174782,7 @@ module.exports = Gravity;
/***/ }),
-/* 1257 */
+/* 1277 */
/***/ (function(module, exports) {
/**
@@ -170415,7 +174824,7 @@ module.exports = Immovable;
/***/ }),
-/* 1258 */
+/* 1278 */
/***/ (function(module, exports) {
/**
@@ -170455,7 +174864,7 @@ module.exports = Mass;
/***/ }),
-/* 1259 */
+/* 1279 */
/***/ (function(module, exports) {
/**
@@ -170493,11 +174902,13 @@ var Size = {
},
/**
- * Sets the size of this physics body. Setting the size does not adjust the dimensions
- * of the parent Game Object.
+ * **DEPRECATED**: Please use `setBodySize` instead.
+ *
+ * Sets the size of this physics body. Setting the size does not adjust the dimensions of the parent Game Object.
*
* @method Phaser.Physics.Arcade.Components.Size#setSize
* @since 3.0.0
+ * @deprecated
*
* @param {number} width - The new width of the physics body, in pixels.
* @param {number} height - The new height of the physics body, in pixels.
@@ -170512,6 +174923,25 @@ var Size = {
return this;
},
+ /**
+ * Sets the size of this physics body. Setting the size does not adjust the dimensions of the parent Game Object.
+ *
+ * @method Phaser.Physics.Arcade.Components.Size#setBodySize
+ * @since 3.24.0
+ *
+ * @param {number} width - The new width of the physics body, in pixels.
+ * @param {number} height - The new height of the physics body, in pixels.
+ * @param {boolean} [center=true] - Should the body be re-positioned so its center aligns with the parent Game Object?
+ *
+ * @return {this} This Game Object.
+ */
+ setBodySize: function (width, height, center)
+ {
+ this.body.setSize(width, height, center);
+
+ return this;
+ },
+
/**
* Sets this physics body to use a circle for collision instead of a rectangle.
*
@@ -170537,7 +174967,7 @@ module.exports = Size;
/***/ }),
-/* 1260 */
+/* 1280 */
/***/ (function(module, exports) {
/**
@@ -170636,13 +175066,13 @@ module.exports = Velocity;
/***/ }),
-/* 1261 */
+/* 1281 */
/***/ (function(module, exports, __webpack_require__) {
-var OverlapRect = __webpack_require__(456);
+var OverlapRect = __webpack_require__(465);
var Circle = __webpack_require__(65);
-var CircleToCircle = __webpack_require__(202);
-var CircleToRectangle = __webpack_require__(203);
+var CircleToCircle = __webpack_require__(211);
+var CircleToRectangle = __webpack_require__(212);
/**
* This method will search the given circular area and return an array of all physics bodies that
@@ -170704,7 +175134,7 @@ module.exports = OverlapCirc;
/***/ }),
-/* 1262 */
+/* 1282 */
/***/ (function(module, exports) {
/**
@@ -170737,7 +175167,7 @@ module.exports = 'collide';
/***/ }),
-/* 1263 */
+/* 1283 */
/***/ (function(module, exports) {
/**
@@ -170770,7 +175200,7 @@ module.exports = 'overlap';
/***/ }),
-/* 1264 */
+/* 1284 */
/***/ (function(module, exports) {
/**
@@ -170793,7 +175223,7 @@ module.exports = 'pause';
/***/ }),
-/* 1265 */
+/* 1285 */
/***/ (function(module, exports) {
/**
@@ -170816,7 +175246,7 @@ module.exports = 'resume';
/***/ }),
-/* 1266 */
+/* 1286 */
/***/ (function(module, exports) {
/**
@@ -170848,7 +175278,7 @@ module.exports = 'tilecollide';
/***/ }),
-/* 1267 */
+/* 1287 */
/***/ (function(module, exports) {
/**
@@ -170880,7 +175310,7 @@ module.exports = 'tileoverlap';
/***/ }),
-/* 1268 */
+/* 1288 */
/***/ (function(module, exports) {
/**
@@ -170912,7 +175342,7 @@ module.exports = 'worldbounds';
/***/ }),
-/* 1269 */
+/* 1289 */
/***/ (function(module, exports) {
/**
@@ -170938,7 +175368,7 @@ module.exports = 'worldstep';
/***/ }),
-/* 1270 */
+/* 1290 */
/***/ (function(module, exports) {
/**
@@ -170979,7 +175409,7 @@ module.exports = ProcessTileCallbacks;
/***/ }),
-/* 1271 */
+/* 1291 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -170988,9 +175418,9 @@ module.exports = ProcessTileCallbacks;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var TileCheckX = __webpack_require__(1272);
-var TileCheckY = __webpack_require__(1274);
-var TileIntersectsBody = __webpack_require__(463);
+var TileCheckX = __webpack_require__(1292);
+var TileCheckY = __webpack_require__(1294);
+var TileIntersectsBody = __webpack_require__(472);
/**
* The core separation function to separate a physics body and a tile.
@@ -171099,7 +175529,7 @@ module.exports = SeparateTile;
/***/ }),
-/* 1272 */
+/* 1292 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -171108,7 +175538,7 @@ module.exports = SeparateTile;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ProcessTileSeparationX = __webpack_require__(1273);
+var ProcessTileSeparationX = __webpack_require__(1293);
/**
* Check the body against the given tile on the X axis.
@@ -171189,7 +175619,7 @@ module.exports = TileCheckX;
/***/ }),
-/* 1273 */
+/* 1293 */
/***/ (function(module, exports) {
/**
@@ -171236,7 +175666,7 @@ module.exports = ProcessTileSeparationX;
/***/ }),
-/* 1274 */
+/* 1294 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -171245,7 +175675,7 @@ module.exports = ProcessTileSeparationX;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ProcessTileSeparationY = __webpack_require__(1275);
+var ProcessTileSeparationY = __webpack_require__(1295);
/**
* Check the body against the given tile on the Y axis.
@@ -171326,7 +175756,7 @@ module.exports = TileCheckY;
/***/ }),
-/* 1275 */
+/* 1295 */
/***/ (function(module, exports) {
/**
@@ -171373,7 +175803,7 @@ module.exports = ProcessTileSeparationY;
/***/ }),
-/* 1276 */
+/* 1296 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -171382,7 +175812,7 @@ module.exports = ProcessTileSeparationY;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetOverlapX = __webpack_require__(460);
+var GetOverlapX = __webpack_require__(469);
/**
* Separates two overlapping bodies on the X-axis (horizontally).
@@ -171442,6 +175872,7 @@ var SeparateX = function (body1, body2, overlapOnly, bias)
if (body2.moves)
{
body1.y += (body2.y - body2.prev.y) * body2.friction.y;
+ body1._dy = body1.y - body1.prev.y;
}
}
else
@@ -171453,6 +175884,7 @@ var SeparateX = function (body1, body2, overlapOnly, bias)
if (body1.moves)
{
body2.y += (body1.y - body1.prev.y) * body1.friction.y;
+ body2._dy = body2.y - body2.prev.y;
}
}
@@ -171464,7 +175896,7 @@ module.exports = SeparateX;
/***/ }),
-/* 1277 */
+/* 1297 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -171473,7 +175905,7 @@ module.exports = SeparateX;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetOverlapY = __webpack_require__(461);
+var GetOverlapY = __webpack_require__(470);
/**
* Separates two overlapping bodies on the Y-axis (vertically).
@@ -171533,6 +175965,7 @@ var SeparateY = function (body1, body2, overlapOnly, bias)
if (body2.moves)
{
body1.x += (body2.x - body2.prev.x) * body2.friction.x;
+ body1._dx = body1.x - body1.prev.x;
}
}
else
@@ -171544,6 +175977,7 @@ var SeparateY = function (body1, body2, overlapOnly, bias)
if (body1.moves)
{
body2.x += (body1.x - body1.prev.x) * body1.friction.x;
+ body2._dx = body2.x - body2.prev.x;
}
}
@@ -171555,21 +175989,19 @@ module.exports = SeparateY;
/***/ }),
-/* 1278 */,
-/* 1279 */,
-/* 1280 */,
-/* 1281 */,
-/* 1282 */,
-/* 1283 */,
-/* 1284 */,
-/* 1285 */,
-/* 1286 */,
-/* 1287 */,
-/* 1288 */,
-/* 1289 */,
-/* 1290 */,
-/* 1291 */,
-/* 1292 */
+/* 1298 */,
+/* 1299 */,
+/* 1300 */,
+/* 1301 */,
+/* 1302 */,
+/* 1303 */,
+/* 1304 */,
+/* 1305 */,
+/* 1306 */,
+/* 1307 */,
+/* 1308 */,
+/* 1309 */,
+/* 1310 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -171584,17 +176016,17 @@ module.exports = SeparateY;
module.exports = {
- BasePlugin: __webpack_require__(468),
- DefaultPlugins: __webpack_require__(173),
+ BasePlugin: __webpack_require__(475),
+ DefaultPlugins: __webpack_require__(180),
PluginCache: __webpack_require__(23),
- PluginManager: __webpack_require__(364),
- ScenePlugin: __webpack_require__(1293)
+ PluginManager: __webpack_require__(370),
+ ScenePlugin: __webpack_require__(1311)
};
/***/ }),
-/* 1293 */
+/* 1311 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -171603,9 +176035,9 @@ module.exports = {
* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}
*/
-var BasePlugin = __webpack_require__(468);
+var BasePlugin = __webpack_require__(475);
var Class = __webpack_require__(0);
-var SceneEvents = __webpack_require__(19);
+var SceneEvents = __webpack_require__(22);
/**
* @classdesc
@@ -171722,7 +176154,7 @@ module.exports = ScenePlugin;
/***/ }),
-/* 1294 */
+/* 1312 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -171731,8 +176163,8 @@ module.exports = ScenePlugin;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Extend = __webpack_require__(17);
-var CONST = __webpack_require__(175);
+var Extend = __webpack_require__(19);
+var CONST = __webpack_require__(183);
/**
* @namespace Phaser.Scale
@@ -171760,12 +176192,12 @@ var CONST = __webpack_require__(175);
var Scale = {
- Center: __webpack_require__(353),
+ Center: __webpack_require__(359),
Events: __webpack_require__(92),
- Orientation: __webpack_require__(354),
- ScaleManager: __webpack_require__(365),
- ScaleModes: __webpack_require__(355),
- Zoom: __webpack_require__(356)
+ Orientation: __webpack_require__(360),
+ ScaleManager: __webpack_require__(371),
+ ScaleModes: __webpack_require__(361),
+ Zoom: __webpack_require__(362)
};
@@ -171778,7 +176210,7 @@ module.exports = Scale;
/***/ }),
-/* 1295 */
+/* 1313 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -171787,8 +176219,8 @@ module.exports = Scale;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CONST = __webpack_require__(123);
-var Extend = __webpack_require__(17);
+var CONST = __webpack_require__(127);
+var Extend = __webpack_require__(19);
/**
* @namespace Phaser.Scenes
@@ -171796,11 +176228,11 @@ var Extend = __webpack_require__(17);
var Scene = {
- Events: __webpack_require__(19),
- SceneManager: __webpack_require__(367),
- ScenePlugin: __webpack_require__(1296),
- Settings: __webpack_require__(369),
- Systems: __webpack_require__(178)
+ Events: __webpack_require__(22),
+ SceneManager: __webpack_require__(373),
+ ScenePlugin: __webpack_require__(1314),
+ Settings: __webpack_require__(375),
+ Systems: __webpack_require__(186)
};
@@ -171811,7 +176243,7 @@ module.exports = Scene;
/***/ }),
-/* 1296 */
+/* 1314 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -171820,9 +176252,9 @@ module.exports = Scene;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Clamp = __webpack_require__(22);
+var Clamp = __webpack_require__(17);
var Class = __webpack_require__(0);
-var Events = __webpack_require__(19);
+var Events = __webpack_require__(22);
var GetFastValue = __webpack_require__(2);
var PluginCache = __webpack_require__(23);
@@ -172135,7 +176567,7 @@ var ScenePlugin = new Class({
if (target.sys.isSleeping())
{
- target.sys.wake();
+ target.sys.wake(GetFastValue(config, 'data'));
}
else
{
@@ -172821,7 +177253,7 @@ module.exports = ScenePlugin;
/***/ }),
-/* 1297 */
+/* 1315 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -172836,18 +177268,18 @@ module.exports = ScenePlugin;
module.exports = {
- List: __webpack_require__(126),
- Map: __webpack_require__(159),
- ProcessQueue: __webpack_require__(184),
- RTree: __webpack_require__(462),
- Set: __webpack_require__(108),
- Size: __webpack_require__(366)
+ List: __webpack_require__(131),
+ Map: __webpack_require__(167),
+ ProcessQueue: __webpack_require__(192),
+ RTree: __webpack_require__(471),
+ Set: __webpack_require__(135),
+ Size: __webpack_require__(372)
};
/***/ }),
-/* 1298 */
+/* 1316 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -172856,8 +177288,8 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Extend = __webpack_require__(17);
-var FilterMode = __webpack_require__(1299);
+var Extend = __webpack_require__(19);
+var FilterMode = __webpack_require__(1317);
/**
* @namespace Phaser.Textures
@@ -172883,14 +177315,14 @@ var FilterMode = __webpack_require__(1299);
var Textures = {
- CanvasTexture: __webpack_require__(371),
- Events: __webpack_require__(119),
+ CanvasTexture: __webpack_require__(377),
+ Events: __webpack_require__(123),
FilterMode: FilterMode,
- Frame: __webpack_require__(94),
- Parsers: __webpack_require__(373),
- Texture: __webpack_require__(180),
- TextureManager: __webpack_require__(370),
- TextureSource: __webpack_require__(372)
+ Frame: __webpack_require__(95),
+ Parsers: __webpack_require__(379),
+ Texture: __webpack_require__(188),
+ TextureManager: __webpack_require__(376),
+ TextureSource: __webpack_require__(378)
};
@@ -172900,7 +177332,7 @@ module.exports = Textures;
/***/ }),
-/* 1299 */
+/* 1317 */
/***/ (function(module, exports) {
/**
@@ -172944,7 +177376,7 @@ module.exports = CONST;
/***/ }),
-/* 1300 */
+/* 1318 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -172959,30 +177391,30 @@ module.exports = CONST;
module.exports = {
- Components: __webpack_require__(137),
- Parsers: __webpack_require__(1330),
+ Components: __webpack_require__(143),
+ Parsers: __webpack_require__(1348),
- Formats: __webpack_require__(31),
- ImageCollection: __webpack_require__(479),
- ParseToTilemap: __webpack_require__(224),
+ Formats: __webpack_require__(32),
+ ImageCollection: __webpack_require__(486),
+ ParseToTilemap: __webpack_require__(233),
Tile: __webpack_require__(74),
- Tilemap: __webpack_require__(488),
- TilemapCreator: __webpack_require__(1339),
- TilemapFactory: __webpack_require__(1340),
- Tileset: __webpack_require__(141),
+ Tilemap: __webpack_require__(495),
+ TilemapCreator: __webpack_require__(1362),
+ TilemapFactory: __webpack_require__(1363),
+ Tileset: __webpack_require__(105),
- LayerData: __webpack_require__(104),
- MapData: __webpack_require__(105),
- ObjectLayer: __webpack_require__(482),
+ LayerData: __webpack_require__(103),
+ MapData: __webpack_require__(104),
+ ObjectLayer: __webpack_require__(489),
- DynamicTilemapLayer: __webpack_require__(489),
- StaticTilemapLayer: __webpack_require__(490)
+ DynamicTilemapLayer: __webpack_require__(496),
+ StaticTilemapLayer: __webpack_require__(497)
};
/***/ }),
-/* 1301 */
+/* 1319 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -172992,7 +177424,7 @@ module.exports = {
*/
var GetTilesWithin = __webpack_require__(24);
-var CalculateFacesWithin = __webpack_require__(51);
+var CalculateFacesWithin = __webpack_require__(52);
/**
* Copies the tiles in the source rectangular area to a new destination (all specified in tile
@@ -173047,7 +177479,7 @@ module.exports = Copy;
/***/ }),
-/* 1302 */
+/* 1320 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173056,10 +177488,10 @@ module.exports = Copy;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var TileToWorldX = __webpack_require__(139);
-var TileToWorldY = __webpack_require__(140);
+var TileToWorldX = __webpack_require__(145);
+var TileToWorldY = __webpack_require__(146);
var GetTilesWithin = __webpack_require__(24);
-var ReplaceByIndex = __webpack_require__(469);
+var ReplaceByIndex = __webpack_require__(476);
/**
* Creates a Sprite for every object matching the given tile indexes in the layer. You can
@@ -173132,7 +177564,7 @@ module.exports = CreateFromTiles;
/***/ }),
-/* 1303 */
+/* 1321 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173142,7 +177574,7 @@ module.exports = CreateFromTiles;
*/
var SnapFloor = __webpack_require__(93);
-var SnapCeil = __webpack_require__(325);
+var SnapCeil = __webpack_require__(334);
/**
* Returns the tiles in the given layer that are within the camera's viewport. This is used internally.
@@ -173289,7 +177721,7 @@ module.exports = CullTiles;
/***/ }),
-/* 1304 */
+/* 1322 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173299,7 +177731,7 @@ module.exports = CullTiles;
*/
var GetTilesWithin = __webpack_require__(24);
-var CalculateFacesWithin = __webpack_require__(51);
+var CalculateFacesWithin = __webpack_require__(52);
var SetTileCollision = __webpack_require__(73);
/**
@@ -173343,7 +177775,7 @@ module.exports = Fill;
/***/ }),
-/* 1305 */
+/* 1323 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173391,7 +177823,7 @@ module.exports = FilterTiles;
/***/ }),
-/* 1306 */
+/* 1324 */
/***/ (function(module, exports) {
/**
@@ -173479,7 +177911,7 @@ module.exports = FindByIndex;
/***/ }),
-/* 1307 */
+/* 1325 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173533,7 +177965,7 @@ module.exports = FindTile;
/***/ }),
-/* 1308 */
+/* 1326 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173583,7 +178015,7 @@ module.exports = ForEachTile;
/***/ }),
-/* 1309 */
+/* 1327 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173592,7 +178024,7 @@ module.exports = ForEachTile;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var GetTileAt = __webpack_require__(138);
+var GetTileAt = __webpack_require__(144);
var WorldToTileX = __webpack_require__(63);
var WorldToTileY = __webpack_require__(64);
@@ -173624,7 +178056,7 @@ module.exports = GetTileAtWorldXY;
/***/ }),
-/* 1310 */
+/* 1328 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173633,12 +178065,12 @@ module.exports = GetTileAtWorldXY;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var Geom = __webpack_require__(422);
+var Geom = __webpack_require__(430);
var GetTilesWithin = __webpack_require__(24);
-var Intersects = __webpack_require__(423);
+var Intersects = __webpack_require__(431);
var NOOP = __webpack_require__(1);
-var TileToWorldX = __webpack_require__(139);
-var TileToWorldY = __webpack_require__(140);
+var TileToWorldX = __webpack_require__(145);
+var TileToWorldY = __webpack_require__(146);
var WorldToTileX = __webpack_require__(63);
var WorldToTileY = __webpack_require__(64);
@@ -173721,7 +178153,7 @@ module.exports = GetTilesWithinShape;
/***/ }),
-/* 1311 */
+/* 1329 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173771,7 +178203,7 @@ module.exports = GetTilesWithinWorldXY;
/***/ }),
-/* 1312 */
+/* 1330 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173780,7 +178212,7 @@ module.exports = GetTilesWithinWorldXY;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var HasTileAt = __webpack_require__(470);
+var HasTileAt = __webpack_require__(477);
var WorldToTileX = __webpack_require__(63);
var WorldToTileY = __webpack_require__(64);
@@ -173811,7 +178243,7 @@ module.exports = HasTileAtWorldXY;
/***/ }),
-/* 1313 */
+/* 1331 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173820,7 +178252,7 @@ module.exports = HasTileAtWorldXY;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var PutTileAt = __webpack_require__(218);
+var PutTileAt = __webpack_require__(227);
var WorldToTileX = __webpack_require__(63);
var WorldToTileY = __webpack_require__(64);
@@ -173854,7 +178286,7 @@ module.exports = PutTileAtWorldXY;
/***/ }),
-/* 1314 */
+/* 1332 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173863,8 +178295,8 @@ module.exports = PutTileAtWorldXY;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var CalculateFacesWithin = __webpack_require__(51);
-var PutTileAt = __webpack_require__(218);
+var CalculateFacesWithin = __webpack_require__(52);
+var PutTileAt = __webpack_require__(227);
/**
* Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified
@@ -173918,7 +178350,7 @@ module.exports = PutTilesAt;
/***/ }),
-/* 1315 */
+/* 1333 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173928,7 +178360,7 @@ module.exports = PutTilesAt;
*/
var GetTilesWithin = __webpack_require__(24);
-var GetRandom = __webpack_require__(183);
+var GetRandom = __webpack_require__(191);
/**
* Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the
@@ -173976,7 +178408,7 @@ module.exports = Randomize;
/***/ }),
-/* 1316 */
+/* 1334 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -173985,7 +178417,7 @@ module.exports = Randomize;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var RemoveTileAt = __webpack_require__(471);
+var RemoveTileAt = __webpack_require__(478);
var WorldToTileX = __webpack_require__(63);
var WorldToTileY = __webpack_require__(64);
@@ -174017,7 +178449,7 @@ module.exports = RemoveTileAtWorldXY;
/***/ }),
-/* 1317 */
+/* 1335 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174027,7 +178459,7 @@ module.exports = RemoveTileAtWorldXY;
*/
var GetTilesWithin = __webpack_require__(24);
-var Color = __webpack_require__(348);
+var Color = __webpack_require__(354);
var defaultTileColor = new Color(105, 210, 231, 150);
var defaultCollidingTileColor = new Color(243, 134, 48, 200);
@@ -174106,7 +178538,7 @@ module.exports = RenderDebug;
/***/ }),
-/* 1318 */
+/* 1336 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174116,8 +178548,8 @@ module.exports = RenderDebug;
*/
var SetTileCollision = __webpack_require__(73);
-var CalculateFacesWithin = __webpack_require__(51);
-var SetLayerCollisionIndex = __webpack_require__(219);
+var CalculateFacesWithin = __webpack_require__(52);
+var SetLayerCollisionIndex = __webpack_require__(228);
/**
* Sets collision on the given tile or tiles within a layer by index. You can pass in either a
@@ -174175,7 +178607,7 @@ module.exports = SetCollision;
/***/ }),
-/* 1319 */
+/* 1337 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174185,8 +178617,8 @@ module.exports = SetCollision;
*/
var SetTileCollision = __webpack_require__(73);
-var CalculateFacesWithin = __webpack_require__(51);
-var SetLayerCollisionIndex = __webpack_require__(219);
+var CalculateFacesWithin = __webpack_require__(52);
+var SetLayerCollisionIndex = __webpack_require__(228);
/**
* Sets collision on a range of tiles in a layer whose index is between the specified `start` and
@@ -174250,7 +178682,7 @@ module.exports = SetCollisionBetween;
/***/ }),
-/* 1320 */
+/* 1338 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174260,13 +178692,13 @@ module.exports = SetCollisionBetween;
*/
var SetTileCollision = __webpack_require__(73);
-var CalculateFacesWithin = __webpack_require__(51);
-var SetLayerCollisionIndex = __webpack_require__(219);
+var CalculateFacesWithin = __webpack_require__(52);
+var SetLayerCollisionIndex = __webpack_require__(228);
/**
* 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).
+ * disabled (false). Tile indexes not currently in the layer are not affected.
*
* @function Phaser.Tilemaps.Components.SetCollisionByExclusion
* @private
@@ -174307,7 +178739,7 @@ module.exports = SetCollisionByExclusion;
/***/ }),
-/* 1321 */
+/* 1339 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174317,8 +178749,8 @@ module.exports = SetCollisionByExclusion;
*/
var SetTileCollision = __webpack_require__(73);
-var CalculateFacesWithin = __webpack_require__(51);
-var HasValue = __webpack_require__(99);
+var CalculateFacesWithin = __webpack_require__(52);
+var HasValue = __webpack_require__(109);
/**
* Sets collision on the tiles within a layer by checking tile properties. If a tile has a property
@@ -174382,7 +178814,7 @@ module.exports = SetCollisionByProperty;
/***/ }),
-/* 1322 */
+/* 1340 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174392,7 +178824,7 @@ module.exports = SetCollisionByProperty;
*/
var SetTileCollision = __webpack_require__(73);
-var CalculateFacesWithin = __webpack_require__(51);
+var CalculateFacesWithin = __webpack_require__(52);
/**
* Sets collision on the tiles within a layer by checking each tile's collision group data
@@ -174442,7 +178874,7 @@ module.exports = SetCollisionFromCollisionGroup;
/***/ }),
-/* 1323 */
+/* 1341 */
/***/ (function(module, exports) {
/**
@@ -174489,7 +178921,7 @@ module.exports = SetTileIndexCallback;
/***/ }),
-/* 1324 */
+/* 1342 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174532,7 +178964,7 @@ module.exports = SetTileLocationCallback;
/***/ }),
-/* 1325 */
+/* 1343 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174542,7 +178974,7 @@ module.exports = SetTileLocationCallback;
*/
var GetTilesWithin = __webpack_require__(24);
-var ShuffleArray = __webpack_require__(114);
+var ShuffleArray = __webpack_require__(116);
/**
* Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given
@@ -174577,7 +179009,7 @@ module.exports = Shuffle;
/***/ }),
-/* 1326 */
+/* 1344 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174628,7 +179060,7 @@ module.exports = SwapByIndex;
/***/ }),
-/* 1327 */
+/* 1345 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174637,8 +179069,8 @@ module.exports = SwapByIndex;
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var TileToWorldX = __webpack_require__(139);
-var TileToWorldY = __webpack_require__(140);
+var TileToWorldX = __webpack_require__(145);
+var TileToWorldY = __webpack_require__(146);
var Vector2 = __webpack_require__(3);
/**
@@ -174672,7 +179104,7 @@ module.exports = TileToWorldXY;
/***/ }),
-/* 1328 */
+/* 1346 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174752,7 +179184,7 @@ module.exports = WeightedRandomize;
/***/ }),
-/* 1329 */
+/* 1347 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174797,7 +179229,7 @@ module.exports = WorldToTileXY;
/***/ }),
-/* 1330 */
+/* 1348 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174812,18 +179244,18 @@ module.exports = WorldToTileXY;
module.exports = {
- Parse: __webpack_require__(472),
- Parse2DArray: __webpack_require__(220),
- ParseCSV: __webpack_require__(473),
+ Parse: __webpack_require__(479),
+ Parse2DArray: __webpack_require__(229),
+ ParseCSV: __webpack_require__(480),
- Impact: __webpack_require__(1331),
- Tiled: __webpack_require__(1332)
+ Impact: __webpack_require__(1349),
+ Tiled: __webpack_require__(1350)
};
/***/ }),
-/* 1331 */
+/* 1349 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174838,15 +179270,15 @@ module.exports = {
module.exports = {
- ParseTileLayers: __webpack_require__(486),
- ParseTilesets: __webpack_require__(487),
- ParseWeltmeister: __webpack_require__(485)
+ ParseTileLayers: __webpack_require__(493),
+ ParseTilesets: __webpack_require__(494),
+ ParseWeltmeister: __webpack_require__(492)
};
/***/ }),
-/* 1332 */
+/* 1350 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174861,22 +179293,22 @@ module.exports = {
module.exports = {
- AssignTileProperties: __webpack_require__(484),
- Base64Decode: __webpack_require__(476),
- BuildTilesetIndex: __webpack_require__(483),
- ParseGID: __webpack_require__(221),
- ParseImageLayers: __webpack_require__(477),
- ParseJSONTiled: __webpack_require__(474),
- ParseObject: __webpack_require__(223),
- ParseObjectLayers: __webpack_require__(481),
- ParseTileLayers: __webpack_require__(475),
- ParseTilesets: __webpack_require__(478)
+ AssignTileProperties: __webpack_require__(491),
+ Base64Decode: __webpack_require__(483),
+ BuildTilesetIndex: __webpack_require__(490),
+ ParseGID: __webpack_require__(230),
+ ParseImageLayers: __webpack_require__(484),
+ ParseJSONTiled: __webpack_require__(481),
+ ParseObject: __webpack_require__(232),
+ ParseObjectLayers: __webpack_require__(488),
+ ParseTileLayers: __webpack_require__(482),
+ ParseTilesets: __webpack_require__(485)
};
/***/ }),
-/* 1333 */
+/* 1351 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174890,12 +179322,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1334);
+ renderWebGL = __webpack_require__(1352);
}
if (true)
{
- renderCanvas = __webpack_require__(1335);
+ renderCanvas = __webpack_require__(1353);
}
module.exports = {
@@ -174907,7 +179339,7 @@ module.exports = {
/***/ }),
-/* 1334 */
+/* 1352 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -174961,12 +179393,15 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer
var tilesets = src.tileset;
+ renderer.setPipeline(pipeline);
+
// 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++)
{
@@ -174979,7 +179414,7 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer
// Skip tiles that aren't in this set
continue;
}
-
+
var tileTexCoords = tileset.getTileTextureCoordinates(tile.index);
if (tileTexCoords === null)
@@ -175014,7 +179449,8 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer
0, 0,
camera,
null,
- true
+ true,
+ textureUnit
);
}
}
@@ -175024,7 +179460,7 @@ module.exports = DynamicTilemapLayerWebGLRenderer;
/***/ }),
-/* 1335 */
+/* 1353 */
/***/ (function(module, exports) {
/**
@@ -175156,7 +179592,7 @@ module.exports = DynamicTilemapLayerCanvasRenderer;
/***/ }),
-/* 1336 */
+/* 1354 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -175170,12 +179606,12 @@ var renderCanvas = __webpack_require__(1);
if (true)
{
- renderWebGL = __webpack_require__(1337);
+ renderWebGL = __webpack_require__(1355);
}
if (true)
{
- renderCanvas = __webpack_require__(1338);
+ renderCanvas = __webpack_require__(1361);
}
module.exports = {
@@ -175187,8 +179623,8 @@ module.exports = {
/***/ }),
-/* 1337 */
-/***/ (function(module, exports) {
+/* 1355 */
+/***/ (function(module, exports, __webpack_require__) {
/**
* @author Richard Davey
@@ -175196,12 +179632,17 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
+var Identity = __webpack_require__(1356);
+var Scale = __webpack_require__(1358);
+var Translate = __webpack_require__(1359);
+var ViewLoad2D = __webpack_require__(1360);
+
/**
* 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
@@ -175215,51 +179656,282 @@ module.exports = {
*/
var StaticTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera)
{
- var tilesets = src.tileset;
-
+ 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.setPipeline(pipeline);
- pipeline.modelIdentity();
- pipeline.modelTranslate(src.x - (camera.scrollX * src.scrollFactorX), src.y - (camera.scrollY * src.scrollFactorY), 0);
- pipeline.modelScale(src.scaleX, src.scaleY, 1);
- pipeline.viewLoad2D(camera.matrix.matrix);
+ // 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 < tilesets.length; i++)
+ for (var i = 0; i < src.tileset.length; i++)
{
+ var tileset = src.tileset[i];
+ var vertexCount = src.vertexCount[i];
+
src.upload(camera, i);
- if (src.vertexCount[i] > 0)
+ if (vertexCount > 0)
{
- if (renderer.currentPipeline && renderer.currentPipeline.vertexCount > 0)
+ if (pipeline.forceZero)
{
- renderer.flush();
+ // Light Pipeline, or similar
+ pipeline.setGameObject(src, tileset);
}
-
- pipeline.vertexBuffer = src.vertexBuffer[i];
-
- renderer.setPipeline(pipeline);
-
- renderer.setTexture2D(tilesets[i].glTexture, 0);
-
- renderer.gl.drawArrays(pipeline.topology, 0, src.vertexCount[i]);
+ else
+ {
+ renderer.setTextureZero(tileset.glTexture);
+ }
+
+ gl.drawArrays(gl.TRIANGLES, 0, vertexCount);
}
}
- // Restore the pipeline
+ renderer.resetTextures();
+
+ // Restore the pipeline buffer
pipeline.vertexBuffer = pipelineVertexBuffer;
- pipeline.viewIdentity();
- pipeline.modelIdentity();
+ 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;
/***/ }),
-/* 1338 */
+/* 1356 */
+/***/ (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__(1357);
+
+/**
+ * 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;
+
+
+/***/ }),
+/* 1357 */
+/***/ (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;
+
+
+/***/ }),
+/* 1358 */
+/***/ (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;
+
+
+/***/ }),
+/* 1359 */
+/***/ (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;
+
+
+/***/ }),
+/* 1360 */
+/***/ (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;
+
+
+/***/ }),
+/* 1361 */
/***/ (function(module, exports) {
/**
@@ -175393,7 +180065,7 @@ module.exports = StaticTilemapLayerCanvasRenderer;
/***/ }),
-/* 1339 */
+/* 1362 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -175403,7 +180075,7 @@ module.exports = StaticTilemapLayerCanvasRenderer;
*/
var GameObjectCreator = __webpack_require__(16);
-var ParseToTilemap = __webpack_require__(224);
+var ParseToTilemap = __webpack_require__(233);
/**
* Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided.
@@ -175437,7 +180109,7 @@ GameObjectCreator.register('tilemap', function (config)
/***/ }),
-/* 1340 */
+/* 1363 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -175447,7 +180119,7 @@ GameObjectCreator.register('tilemap', function (config)
*/
var GameObjectFactory = __webpack_require__(5);
-var ParseToTilemap = __webpack_require__(224);
+var ParseToTilemap = __webpack_require__(233);
/**
* Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided.
@@ -175503,7 +180175,7 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt
/***/ }),
-/* 1341 */
+/* 1364 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -175518,14 +180190,14 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt
module.exports = {
- Clock: __webpack_require__(1342),
- TimerEvent: __webpack_require__(491)
+ Clock: __webpack_require__(1365),
+ TimerEvent: __webpack_require__(498)
};
/***/ }),
-/* 1342 */
+/* 1365 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -175536,8 +180208,8 @@ module.exports = {
var Class = __webpack_require__(0);
var PluginCache = __webpack_require__(23);
-var SceneEvents = __webpack_require__(19);
-var TimerEvent = __webpack_require__(491);
+var SceneEvents = __webpack_require__(22);
+var TimerEvent = __webpack_require__(498);
/**
* @classdesc
@@ -175931,7 +180603,7 @@ module.exports = Clock;
/***/ }),
-/* 1343 */
+/* 1366 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -175941,7 +180613,7 @@ module.exports = Clock;
*/
var CONST = __webpack_require__(89);
-var Extend = __webpack_require__(17);
+var Extend = __webpack_require__(19);
/**
* @namespace Phaser.Tweens
@@ -175949,13 +180621,13 @@ var Extend = __webpack_require__(17);
var Tweens = {
- Builders: __webpack_require__(1344),
- Events: __webpack_require__(229),
+ Builders: __webpack_require__(1367),
+ Events: __webpack_require__(238),
- TweenManager: __webpack_require__(1359),
- Tween: __webpack_require__(228),
- TweenData: __webpack_require__(230),
- Timeline: __webpack_require__(497)
+ TweenManager: __webpack_require__(1383),
+ Tween: __webpack_require__(237),
+ TweenData: __webpack_require__(239),
+ Timeline: __webpack_require__(504)
};
@@ -175966,7 +180638,7 @@ module.exports = Tweens;
/***/ }),
-/* 1344 */
+/* 1367 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -175982,22 +180654,22 @@ module.exports = Tweens;
module.exports = {
GetBoolean: __webpack_require__(88),
- GetEaseFunction: __webpack_require__(82),
- GetNewValue: __webpack_require__(142),
- GetProps: __webpack_require__(492),
- GetTargets: __webpack_require__(225),
- GetTweens: __webpack_require__(493),
- GetValueOp: __webpack_require__(226),
- NumberTweenBuilder: __webpack_require__(494),
- StaggerBuilder: __webpack_require__(495),
- TimelineBuilder: __webpack_require__(496),
- TweenBuilder: __webpack_require__(143)
+ GetEaseFunction: __webpack_require__(69),
+ GetNewValue: __webpack_require__(147),
+ GetProps: __webpack_require__(499),
+ GetTargets: __webpack_require__(234),
+ GetTweens: __webpack_require__(500),
+ GetValueOp: __webpack_require__(235),
+ NumberTweenBuilder: __webpack_require__(501),
+ StaggerBuilder: __webpack_require__(502),
+ TimelineBuilder: __webpack_require__(503),
+ TweenBuilder: __webpack_require__(148)
};
/***/ }),
-/* 1345 */
+/* 1368 */
/***/ (function(module, exports) {
/**
@@ -176017,7 +180689,7 @@ module.exports = {
// flipY: flip Y the GameObject on tween end// hold: The time the tween will pause before running a yoyo
// hold: The time the tween will pause before running a yoyo
// loop: The time the tween will pause before starting either a yoyo or returning to the start for a repeat
-// loopDelay:
+// loopDelay:
// offset: Used when the Tween is part of a Timeline
// paused: Does the tween start in a paused state, or playing?
// props: The properties being tweened by the tween
@@ -176055,6 +180727,9 @@ module.exports = [
'onStart',
'onStartParams',
'onStartScope',
+ 'onStop',
+ 'onStopParams',
+ 'onStopScope',
'onUpdate',
'onUpdateParams',
'onUpdateScope',
@@ -176072,7 +180747,7 @@ module.exports = [
/***/ }),
-/* 1346 */
+/* 1369 */
/***/ (function(module, exports) {
/**
@@ -176108,7 +180783,7 @@ module.exports = 'complete';
/***/ }),
-/* 1347 */
+/* 1370 */
/***/ (function(module, exports) {
/**
@@ -176145,7 +180820,7 @@ module.exports = 'loop';
/***/ }),
-/* 1348 */
+/* 1371 */
/***/ (function(module, exports) {
/**
@@ -176182,7 +180857,7 @@ module.exports = 'pause';
/***/ }),
-/* 1349 */
+/* 1372 */
/***/ (function(module, exports) {
/**
@@ -176219,7 +180894,7 @@ module.exports = 'resume';
/***/ }),
-/* 1350 */
+/* 1373 */
/***/ (function(module, exports) {
/**
@@ -176255,7 +180930,7 @@ module.exports = 'start';
/***/ }),
-/* 1351 */
+/* 1374 */
/***/ (function(module, exports) {
/**
@@ -176292,7 +180967,7 @@ module.exports = 'update';
/***/ }),
-/* 1352 */
+/* 1375 */
/***/ (function(module, exports) {
/**
@@ -176332,7 +181007,7 @@ module.exports = 'active';
/***/ }),
-/* 1353 */
+/* 1376 */
/***/ (function(module, exports) {
/**
@@ -176373,7 +181048,7 @@ module.exports = 'complete';
/***/ }),
-/* 1354 */
+/* 1377 */
/***/ (function(module, exports) {
/**
@@ -176417,7 +181092,7 @@ module.exports = 'loop';
/***/ }),
-/* 1355 */
+/* 1378 */
/***/ (function(module, exports) {
/**
@@ -176462,7 +181137,7 @@ module.exports = 'repeat';
/***/ }),
-/* 1356 */
+/* 1379 */
/***/ (function(module, exports) {
/**
@@ -176502,7 +181177,43 @@ module.exports = 'start';
/***/ }),
-/* 1357 */
+/* 1380 */
+/***/ (function(module, exports) {
+
+/**
+ * @author samme
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+/**
+ * The Tween Stop Event.
+ *
+ * This event is dispatched by a Tween when it is stopped.
+ *
+ * Listen to it from a Tween instance using `Tween.on('stop', listener)`, i.e.:
+ *
+ * ```javascript
+ * var tween = this.tweens.add({
+ * targets: image,
+ * x: 500,
+ * ease: 'Power1',
+ * duration: 3000
+ * });
+ * tween.on('stop', listener);
+ * ```
+ *
+ * @event Phaser.Tweens.Events#TWEEN_STOP
+ * @since 3.24.0
+ *
+ * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event.
+ * @param {any[]} targets - An array of references to the target/s the Tween is operating on.
+ */
+module.exports = 'stop';
+
+
+/***/ }),
+/* 1381 */
/***/ (function(module, exports) {
/**
@@ -176545,7 +181256,7 @@ module.exports = 'update';
/***/ }),
-/* 1358 */
+/* 1382 */
/***/ (function(module, exports) {
/**
@@ -176591,7 +181302,7 @@ module.exports = 'yoyo';
/***/ }),
-/* 1359 */
+/* 1383 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -176600,15 +181311,15 @@ module.exports = 'yoyo';
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-var ArrayRemove = __webpack_require__(121);
+var ArrayRemove = __webpack_require__(125);
var Class = __webpack_require__(0);
-var NumberTweenBuilder = __webpack_require__(494);
+var NumberTweenBuilder = __webpack_require__(501);
var PluginCache = __webpack_require__(23);
-var SceneEvents = __webpack_require__(19);
-var StaggerBuilder = __webpack_require__(495);
-var TimelineBuilder = __webpack_require__(496);
+var SceneEvents = __webpack_require__(22);
+var StaggerBuilder = __webpack_require__(502);
+var TimelineBuilder = __webpack_require__(503);
var TWEEN_CONST = __webpack_require__(89);
-var TweenBuilder = __webpack_require__(143);
+var TweenBuilder = __webpack_require__(148);
/**
* @classdesc
@@ -176761,7 +181472,7 @@ var TweenManager = new Class({
},
/**
- * Create a Tween Timeline and add it to the active Tween list/
+ * Create a Tween Timeline and add it to the active Tween list.
*
* @method Phaser.Tweens.TweenManager#timeline
* @since 3.0.0
@@ -177363,7 +182074,7 @@ module.exports = TweenManager;
/***/ }),
-/* 1360 */
+/* 1384 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -177378,16 +182089,16 @@ module.exports = TweenManager;
module.exports = {
- Array: __webpack_require__(181),
- Base64: __webpack_require__(1361),
- Objects: __webpack_require__(1363),
- String: __webpack_require__(1367)
+ Array: __webpack_require__(189),
+ Base64: __webpack_require__(1385),
+ Objects: __webpack_require__(1387),
+ String: __webpack_require__(1391)
};
/***/ }),
-/* 1361 */
+/* 1385 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -177402,14 +182113,14 @@ module.exports = {
module.exports = {
- ArrayBufferToBase64: __webpack_require__(1362),
- Base64ToArrayBuffer: __webpack_require__(380)
+ ArrayBufferToBase64: __webpack_require__(1386),
+ Base64ToArrayBuffer: __webpack_require__(388)
};
/***/ }),
-/* 1362 */
+/* 1386 */
/***/ (function(module, exports) {
/**
@@ -177467,7 +182178,7 @@ module.exports = ArrayBufferToBase64;
/***/ }),
-/* 1363 */
+/* 1387 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -177483,25 +182194,25 @@ module.exports = ArrayBufferToBase64;
module.exports = {
Clone: __webpack_require__(67),
- Extend: __webpack_require__(17),
+ Extend: __webpack_require__(19),
GetAdvancedValue: __webpack_require__(15),
GetFastValue: __webpack_require__(2),
- GetMinMaxValue: __webpack_require__(1364),
+ GetMinMaxValue: __webpack_require__(1388),
GetValue: __webpack_require__(6),
- HasAll: __webpack_require__(1365),
- HasAny: __webpack_require__(399),
- HasValue: __webpack_require__(99),
+ HasAll: __webpack_require__(1389),
+ HasAny: __webpack_require__(407),
+ HasValue: __webpack_require__(109),
IsPlainObject: __webpack_require__(7),
- Merge: __webpack_require__(107),
- MergeRight: __webpack_require__(1366),
- Pick: __webpack_require__(480),
- SetValue: __webpack_require__(419)
+ Merge: __webpack_require__(128),
+ MergeRight: __webpack_require__(1390),
+ Pick: __webpack_require__(487),
+ SetValue: __webpack_require__(427)
};
/***/ }),
-/* 1364 */
+/* 1388 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -177511,7 +182222,7 @@ module.exports = {
*/
var GetValue = __webpack_require__(6);
-var Clamp = __webpack_require__(22);
+var Clamp = __webpack_require__(17);
/**
* Retrieves and clamps a numerical value from an object.
@@ -177540,7 +182251,7 @@ module.exports = GetMinMaxValue;
/***/ }),
-/* 1365 */
+/* 1389 */
/***/ (function(module, exports) {
/**
@@ -177577,7 +182288,7 @@ module.exports = HasAll;
/***/ }),
-/* 1366 */
+/* 1390 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -177620,7 +182331,7 @@ module.exports = MergeRight;
/***/ }),
-/* 1367 */
+/* 1391 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -177635,17 +182346,18 @@ module.exports = MergeRight;
module.exports = {
- Format: __webpack_require__(1368),
- Pad: __webpack_require__(160),
- Reverse: __webpack_require__(1369),
- UppercaseFirst: __webpack_require__(179),
- UUID: __webpack_require__(194)
+ Format: __webpack_require__(1392),
+ Pad: __webpack_require__(168),
+ RemoveAt: __webpack_require__(1393),
+ Reverse: __webpack_require__(1394),
+ UppercaseFirst: __webpack_require__(187),
+ UUID: __webpack_require__(202)
};
/***/ }),
-/* 1368 */
+/* 1392 */
/***/ (function(module, exports) {
/**
@@ -177680,7 +182392,43 @@ module.exports = Format;
/***/ }),
-/* 1369 */
+/* 1393 */
+/***/ (function(module, exports) {
+
+/**
+ * @author Richard Davey
+ * @copyright 2020 Photon Storm Ltd.
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
+ */
+
+/**
+ * Takes a string and removes the character at the given index.
+ *
+ * @function Phaser.Utils.String.RemoveAt
+ * @since 3.50.0
+ *
+ * @param {string} string - The string to be worked on.
+ * @param {number} index - The index of the character to be removed.
+ *
+ * @return {string} The modified string.
+ */
+var RemoveAt = function (string, index)
+{
+ if (index === 0)
+ {
+ return string.slice(1);
+ }
+ else
+ {
+ return string.slice(0, index - 1) + string.slice(index);
+ }
+};
+
+module.exports = RemoveAt;
+
+
+/***/ }),
+/* 1394 */
/***/ (function(module, exports) {
/**
@@ -177709,7 +182457,7 @@ module.exports = Reverse;
/***/ }),
-/* 1370 */
+/* 1395 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -177725,51 +182473,26 @@ module.exports = Reverse;
module.exports = {
- SoundManagerCreator: __webpack_require__(374),
+ SoundManagerCreator: __webpack_require__(380),
Events: __webpack_require__(59),
- BaseSound: __webpack_require__(125),
- BaseSoundManager: __webpack_require__(124),
+ BaseSound: __webpack_require__(130),
+ BaseSoundManager: __webpack_require__(129),
- WebAudioSound: __webpack_require__(381),
- WebAudioSoundManager: __webpack_require__(379),
+ WebAudioSound: __webpack_require__(389),
+ WebAudioSoundManager: __webpack_require__(387),
- HTML5AudioSound: __webpack_require__(376),
- HTML5AudioSoundManager: __webpack_require__(375),
+ HTML5AudioSound: __webpack_require__(384),
+ HTML5AudioSoundManager: __webpack_require__(381),
- NoAudioSound: __webpack_require__(378),
- NoAudioSoundManager: __webpack_require__(377)
+ NoAudioSound: __webpack_require__(386),
+ NoAudioSoundManager: __webpack_require__(385)
};
/***/ }),
-/* 1371 */,
-/* 1372 */,
-/* 1373 */,
-/* 1374 */,
-/* 1375 */,
-/* 1376 */,
-/* 1377 */,
-/* 1378 */,
-/* 1379 */,
-/* 1380 */,
-/* 1381 */,
-/* 1382 */,
-/* 1383 */,
-/* 1384 */,
-/* 1385 */,
-/* 1386 */,
-/* 1387 */,
-/* 1388 */,
-/* 1389 */,
-/* 1390 */,
-/* 1391 */,
-/* 1392 */,
-/* 1393 */,
-/* 1394 */,
-/* 1395 */,
/* 1396 */,
/* 1397 */,
/* 1398 */,
@@ -177822,12 +182545,7 @@ module.exports = {
/* 1445 */,
/* 1446 */,
/* 1447 */,
-/* 1448 */,
-/* 1449 */,
-/* 1450 */,
-/* 1451 */,
-/* 1452 */,
-/* 1453 */
+/* 1448 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
@@ -177836,10 +182554,10 @@ module.exports = {
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
-__webpack_require__(512);
+__webpack_require__(519);
-var CONST = __webpack_require__(29);
-var Extend = __webpack_require__(17);
+var CONST = __webpack_require__(33);
+var Extend = __webpack_require__(19);
/**
* @namespace Phaser
@@ -177854,37 +182572,37 @@ var Extend = __webpack_require__(17);
var Phaser = {
- Actions: __webpack_require__(238),
- Animations: __webpack_require__(632),
- Cache: __webpack_require__(633),
- Cameras: __webpack_require__(636),
- Core: __webpack_require__(719),
+ Actions: __webpack_require__(245),
+ Animations: __webpack_require__(639),
+ Cache: __webpack_require__(640),
+ Cameras: __webpack_require__(643),
+ Core: __webpack_require__(729),
Class: __webpack_require__(0),
- Create: __webpack_require__(781),
- Curves: __webpack_require__(787),
- Data: __webpack_require__(790),
- Display: __webpack_require__(792),
- DOM: __webpack_require__(809),
- Events: __webpack_require__(810),
- Game: __webpack_require__(812),
- GameObjects: __webpack_require__(905),
- Geom: __webpack_require__(422),
- Input: __webpack_require__(1187),
- Loader: __webpack_require__(1221),
- Math: __webpack_require__(168),
+ Create: __webpack_require__(792),
+ Curves: __webpack_require__(798),
+ Data: __webpack_require__(801),
+ Display: __webpack_require__(803),
+ DOM: __webpack_require__(821),
+ Events: __webpack_require__(822),
+ Game: __webpack_require__(824),
+ GameObjects: __webpack_require__(917),
+ Geom: __webpack_require__(430),
+ Input: __webpack_require__(1207),
+ Loader: __webpack_require__(1241),
+ Math: __webpack_require__(175),
Physics: {
- Arcade: __webpack_require__(1247)
+ Arcade: __webpack_require__(1267)
},
- Plugins: __webpack_require__(1292),
- Scale: __webpack_require__(1294),
- Scene: __webpack_require__(368),
- Scenes: __webpack_require__(1295),
- Structs: __webpack_require__(1297),
- Textures: __webpack_require__(1298),
- Tilemaps: __webpack_require__(1300),
- Time: __webpack_require__(1341),
- Tweens: __webpack_require__(1343),
- Utils: __webpack_require__(1360)
+ Plugins: __webpack_require__(1310),
+ Scale: __webpack_require__(1312),
+ Scene: __webpack_require__(374),
+ Scenes: __webpack_require__(1313),
+ Structs: __webpack_require__(1315),
+ Textures: __webpack_require__(1316),
+ Tilemaps: __webpack_require__(1318),
+ Time: __webpack_require__(1364),
+ Tweens: __webpack_require__(1366),
+ Utils: __webpack_require__(1384)
};
@@ -177894,7 +182612,7 @@ Phaser = Extend(false, Phaser, CONST);
if (true)
{
- Phaser.Sound = __webpack_require__(1370);
+ Phaser.Sound = __webpack_require__(1395);
}
// Export it
@@ -177909,7 +182627,7 @@ global.Phaser = Phaser;
* -- Dick Brandon
*/
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(511)))
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(518)))
/***/ })
/******/ ]);
diff --git a/dist/phaser-arcade-physics.min.js b/dist/phaser-arcade-physics.min.js
index 1d5ef78f6..24e179c9a 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 function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1453)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,e,s,r){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},function(t,e,i){var n=i(0),s=i(46),r=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=s.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=r},function(t,e,i){var n=i(0),s=i(23),r=i(19),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},s.register("GameObjectFactory",o,"add"),t.exports=o},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>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;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,i){t.exports={Alpha:i(527),AlphaSingle:i(266),Animation:i(498),BlendMode:i(269),ComputedSize:i(546),Crop:i(547),Depth:i(270),Flip:i(548),GetBounds:i(549),Mask:i(274),Origin:i(566),PathFollower:i(567),Pipeline:i(153),ScrollFactor:i(277),Size:i(568),Texture:i(569),TextureCrop:i(570),Tint:i(571),ToJSON:i(278),Transform:i(279),TransformMatrix:i(32),Visible:i(280)}},function(t,e){var i={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=i},function(t,e,i){var n=i(0),s=i(278),r=i(113),o=i(9),a=i(90),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 r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},getData:function(t){return this.data||(this.data=new r(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},update:function(){},toJSON:function(){return s(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,e.parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.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,i){var n=i(168),s=i(6);t.exports=function(t,e,i){var r=s(t,e,null);if(null===r)return i;if(Array.isArray(r))return n.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return n.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return n.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},function(t,e,i){var n=i(0),s=i(23),r=i(19),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},s.register("GameObjectCreator",o,"make"),t.exports=o},function(t,e,i){var n=i(7),s=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=400&&t.status<=599&&(n=!1),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(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.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(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.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){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.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){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e){var i={},n={},s={register:function(t,e,n,s){void 0===s&&(s=!1),i[t]={plugin:e,mapping:n,custom:s}},registerCustom:function(t,e,i,s){n[t]={plugin:e,mapping:i,data:s}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return n.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return n[t]},getCustomClass:function(t){return n.hasOwnProperty(t)?n[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){n.hasOwnProperty(t)&&delete n[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in n)n.hasOwnProperty(t)&&delete n[t]}};t.exports=s},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===s&&(s=o.height);var a=n(r,"isNotEmpty",!1),h=n(r,"isColliding",!1),l=n(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n,s,r,o=i(29),a=i(164),h=[],l=!1;t.exports={create2D:function(t,e,i){return n(t,e,i,o.CANVAS)},create:n=function(t,e,i,n,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=o.CANVAS),void 0===r&&(r=!1);var c=s(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&n===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return n(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||r?s.TAU-(r>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[5]=s*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,s,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(s||r){var h=Math.sqrt(s*s+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-s/h):-Math.acos(s/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,s){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var n=this.matrix,s=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(s*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=s*c*e+-o*c*t+(-u*s+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=o},function(t,e,i){var n=i(0),s=i(162),r=i(292),o=i(163),a=i(293),h=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=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(13);t.exports=function(t){return t*n.DEG_TO_RAD}},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){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},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=function(t){return t.y-t.height*t.originY}},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,i){t.exports={DESTROY:i(641),FADE_IN_COMPLETE:i(642),FADE_IN_START:i(643),FADE_OUT_COMPLETE:i(644),FADE_OUT_START:i(645),FLASH_COMPLETE:i(646),FLASH_START:i(647),PAN_COMPLETE:i(648),PAN_START:i(649),POST_RENDER:i(650),PRE_RENDER:i(651),SHAKE_COMPLETE:i(652),SHAKE_START:i(653),ZOOM_COMPLETE:i(654),ZOOM_START:i(655)}},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 n=i(138),s=i(24);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;d0&&e>=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,i){var n=i(0),s=i(272),r=i(150),o=i(46),a=i(151),h=i(3),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=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.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){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){t.exports={COMPLETE:i(882),DECODED:i(883),DECODED_ALL:i(884),DESTROY:i(885),DETUNE:i(886),GLOBAL_DETUNE:i(887),GLOBAL_MUTE:i(888),GLOBAL_RATE:i(889),GLOBAL_VOLUME:i(890),LOOP:i(891),LOOPED:i(892),MUTE:i(893),PAUSE_ALL:i(894),PAUSE:i(895),PLAY:i(896),RATE:i(897),RESUME_ALL:i(898),RESUME:i(899),SEEK:i(900),STOP_ALL:i(901),STOP:i(902),UNLOCKED:i(903),VOLUME:i(904)}},function(t,e,i){var n=i(0),s=i(20),r=i(21),o=i(8),a=i(2),h=i(6),l=i(7),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s80*i){n=h=t[0],a=l=t[1];for(var T=i;Th&&(h=u),f>l&&(l=f);g=0!==(g=Math.max(h-n,l-a))?1/g:0}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===A(t,e,i,n)>0)for(r=e;r=e;r-=n)o=E(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(_(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(_(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),_(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.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=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.prevZ,v=t.nextZ;p&&p.z>=c&&v&&v.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&T(s,r)&&T(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),_(n),_(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=w(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=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&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&T(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=w(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(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&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&T(t,e)&&T(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{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}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function T(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function w(t,e){var i=new b(t.i,t.x,t.y),n=new b(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function E(t,e,i,n){var s=new b(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function _(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function b(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var n=i(0),s=i(12),r=i(14),o=i(960),a=new n({Extends:r,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,o],initialize:function(t,e,i,n,o){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p=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(20),r=i(21),o=i(8),a=i(2),h=i(7),l=new n({Extends:r,initialize:function t(e,i,n,s,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:s,config:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,o);f.type="normalMap",this.setLink(f),e.addFile(f)}},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.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))}});o.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){(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));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(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));return 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){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){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;si&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var n=0;n<=t;n++)i.push(this.getPoint(n/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var n=0;n<=t;n++){var s=this.getUtoTmapping(n/t,null,t);i.push(this.getPoint(s))}return i},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){t.exports={ADD:i(861),COMPLETE:i(862),FILE_COMPLETE:i(863),FILE_KEY_COMPLETE:i(864),FILE_LOAD_ERROR:i(865),FILE_LOAD:i(866),FILE_PROGRESS:i(867),POST_PROCESS:i(868),PROGRESS:i(869),START:i(870)}},function(t,e,i){var n=i(166),s=i(179);t.exports=function(t,e){var i=n.Power0;if("string"==typeof t)if(n.hasOwnProperty(t))i=n[t];else{var r="";t.indexOf(".")&&("in"===(r=t.substr(t.indexOf(".")+1)).toLowerCase()?r="easeIn":"out"===r.toLowerCase()?r="easeOut":"inout"===r.toLowerCase()&&(r="easeInOut")),t=s(t.substr(0,t.indexOf(".")+1)+r),n.hasOwnProperty(t)&&(i=n[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(u-h)*(r-l)-(c-l)*(s-h),f=(o-s)*(r-l)-(a-r)*(s-h),p=(c-l)*(o-s)-(u-h)*(a-r);if(0===p)return!1;var g=d/p,v=f/p;return g>=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},,function(t,e,i){var n=i(22);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){t.exports={DESTROY:i(576),VIDEO_COMPLETE:i(577),VIDEO_CREATED:i(578),VIDEO_ERROR:i(579),VIDEO_LOOP:i(580),VIDEO_PLAY:i(581),VIDEO_SEEKED:i(582),VIDEO_SEEKING:i(583),VIDEO_STOP:i(584),VIDEO_TIMEOUT:i(585),VIDEO_UNLOCKED:i(586)}},function(t,e,i){var n=i(0),s=i(12),r=i(35),o=i(9),a=i(48),h=i(11),l=i(32),u=i(161),c=i(3),d=new n({Extends:o,Mixins:[s.Alpha,s.Visible],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),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;g