Merge remote-tracking branch 'upstream/master'

This commit is contained in:
iamchristopher 2018-04-22 15:25:49 -04:00
commit 0b684e5734
226 changed files with 207305 additions and 130852 deletions

View file

@ -51,6 +51,7 @@
"linebreak-style": [ "off" ],
"lines-around-comment": [ "error", { "beforeBlockComment": true, "afterBlockComment": false, "beforeLineComment": true, "afterLineComment": false, "allowBlockStart": true, "allowBlockEnd": false, "allowObjectStart": true, "allowArrayStart": true }],
"new-parens": "error",
"no-constant-condition": 0,
"no-array-constructor": "error",
"no-lonely-if": "error",
"no-mixed-spaces-and-tabs": "error",

View file

@ -18,54 +18,57 @@ Before contributing, please read the [code of conduct](https://github.com/photon
**5. Share as much information as possible.** Include browser version affected, your OS, version of the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed.
## Pixi and Phaser
Phaser doesn't use Pixi anymore.
## Support Forum
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 and Pixi teams, so it's a great place to get support from. You're welcome to report bugs directly on GitHub, but for general support we'd always recommend using the forum first.
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.
## Making Changes
To take advantage of our grunt build script and jshint config it will be easiest for you if you have node.js and grunt installed locally.
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.
You can download node.js from [nodejs.org][3]. After it has been installed open a console and run `npm i -g grunt-cli` to install the global `grunt` executable.
### 1. Checkout the repos
After that you can clone the repository and run `npm i` inside the cloned folder. This will install dependencies necessary for building the project. Once that is ready,
make your changes and submit a Pull Request:
Check-out both the [Phaser repo](https://github.com/photonstorm/phaser) and the [Phaser 3 Examples Repo](https://github.com/photonstorm/phaser3-examples). Make sure the Phaser 3 Examples repo is saved locally in a folder called `phaser3-examples`, which will be the default for most Git clients.
- **Send Pull Requests to the `master` branch.** We _used_ to insist PRs went to `dev` but have removed this policy since the release of Phaser CE.
### 2. Matching Directory Levels
- **Ensure changes are jshint validated.** Our JSHint configuration file is provided in the repository and you should check against it before submitting.
Ensure that both repos live at the same depth in your directory structure. For example: `/usr/home/web/phaser` and `/usr/home/web/phaser3-examples`. This is so the dev build scripts in the Phaser repo can safely copy files to `../phaser3-examples` and have them end up in the correct place.
- **Never commit new builds.** When making a code change you should always run `grunt` which will rebuild the project so you can test, *however* please do not commit these new builds or your PR will be closed. Builds by default are placed in the `dist` folder, to keep them separate from the `build` folder releases.
### 3. Install dependencies
- **Only commit relevant changes.** Don't include changes that are not directly relevant to the fix you are making. The more focused a PR is, the faster it will get attention and be merged. Extra files changing only whitespace or trash files will likely get your PR closed.
Using your console, run `npm install` or `yarn install` as we've configs for both. This process will install a local copy of webpack and a handful of small support scripts. Note that Yarn on Windows seems to have issues making some packages global, so stick with npm if this is the case.
### 4. Webpack
Making sure you've got both repos checked out, and at the same directory level in your filesystem, issue the command `webpack`. If you can't issue the command then webpack may need [installing globally](https://webpack.js.org/guides/installation/). Webpack will build Phaser and if there are any path errors in the code they'll be flagged during the build process.
What you need is the ability to issue the command `webpack` within the v3 folder and have it work.
### 5. ESLint
There is an ESLint configuration and an Editor Configuration in the v3 folder. **Please adhere to them!** Although not enforced in the build process yet, I will be adding that at a later point. There are lots of tools you can install so your editor of choice will check the ESLint config during development.
To test if your code passes our lint config issue the command `npm run lint`.
## Coding style preferences are not contributions
If your PR is doing little more than changing the Phaser source code into a format / coding style that you prefer then we will automatically close it. All PRs must adhere to the coding style already set-out across the thousands of lines of code in Phaser. Your personal preferences for how things should "look" or be structured do not apply here, sorry. PRs should fix bugs, fix documentation or add features. No changes for the sake of change.
## I don't really like git / node.js, but I can fix this bug
That is fine too. While Pull Requests are the best thing in the world for us, they are not the only way to help. You're welcome to post fixes to our forum or even just email them to us. All we ask is that you still adhere to the guidelines presented here re: JSHint, etc.
## Code Style Guide
We provide an .editorconfig and eslint config for you to use, but generally:
- Use 4 spaces for tabs, never tab characters.
- No trailing whitespace, blank lines should have no whitespace.
- Always favor strict equals `===` unless you *need* to use type coercion.
- Follow conventions already in the code, and listen to jshint. Our config is set-up for a reason.
- Follow conventions already in the code, and listen to eslint. Our config is set-up for a reason.
Thanks to Chad for creating the original Pixi.js Contributing file which we adapted for Phaser.

View file

@ -1,17 +1,9 @@
**This repo is for Phaser 3 related issues only**
This repo is for Phaser 3 related issues only. If you've found an issue with Phaser 2 please see the [Phaser CE (Community Edition)](https://github.com/photonstorm/phaser-ce) repo instead.
Official support for Phaser 2 has now ended. We urge you to visit the [Phaser CE (Community Edition)](https://github.com/photonstorm/phaser-ce) for continued development of v2.
This Issue is about (delete as applicable)
* A bug in the API (always say which version you're using!)
* An error in the documentation
* An error in the TypeScript defs
* An error on the web site
* A problem with my own code
This should not be used for technical support. If you're struggling trying to use Phaser then post your question to the [forum](http://www.html5gamedevs.com/forum/33-phaser-3/), [Slack](https://phaser.io/community/slack) or [Discord](https://phaser.io/community/discord) channels. GitHub Issues are for bugs and feature requests only.
API errors must include example code showing what happens, and why you don't believe this is the expected behavior. Issues posted without code take _far_ longer to get resolved, _if ever_. Feel free to use a site such as jsBin or [CodePen](https://codepen.io/pen?template=YeEWom) to demo the problem. If we can run it, and see the error, we can usually fix it.
If your Issue contains _any_ form of hostility it will be instantly closed.
If your Issue contains _any_ form of hostility it will be instantly closed and you will be blocked from access to all our repos.
**Be nice. We do this for free.**

View file

@ -1,11 +1,10 @@
** >> Make sure you describe your PR to the README Change Log section! << **
Please do not update the README or Change Log, we will do this when we merge your PR.
This PR changes (delete as applicable)
This PR (delete as applicable)
* Documentation
* TypeScript Defs
* The public-facing API
* Nothing, it's a bug fix
* Updates the Documentation
* Adds a new feature
* Fixes a bug
Describe the changes below:

View file

@ -1,6 +1,81 @@
# Change Log
## Version 3.5.0 - in development
## Version 3.6.1 - Asuna - in development
### New Features
* The Phaser 3 Labs has gained a nifty 'search' feature box thanks to @NemoStein - it allows you to filter out the example categories.
* We've added a Mask component, which is available on nearly all Game Objects. It includes the methods `setMask`, `clearMask`, `createBitmapMask` and `createGeometryMask`.
### Updates
* If you're using Webpack with Phaser you'll need to update your config to match our new one.
* We've swapped use of the Webpack DefinePlugin so instead of setting a global flag for the compilation of the Canvas and WebGL renderers, we now use a typeof check instead. This means you should now be able to ingest the Phaser source more easily outside of Webpack without having to define any global vars first (thanks @tgrajewski)
* Under Webpack we still use the raw-loader to import our shader source, but outside of Webpack we now use `require.extensions` to load the shader source via fs. This should allow you to bundle Phaser with packages other than Webpack more easily (thanks @tgrajewski)
* The Texture Manager will now emit an `addtexture` event whenever you add a new texture to it, which includes when you load images files from the Loader (as it automatically populates the Texture Manager). Once you receive an `addtexture` event you know the image is loaded and the texture is safe to be applied to a Game Object.
### Bug Fixes
* DataManagerPlugin would throw an error on Game.destroy if you had any Scenes in the Scene Manager had not been run. Fix #3596 (thanks @kuoruan)
### 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:
@wtravO
## Version 3.6.0 - Asuna - 19th April 2018
### New Features
* Containers are now fully available! We have removed the beta warning and fixed the way in which they work with Cameras, input and scroll factors. They are also fully documented, so please see their docs and examples for use.
* Group.getLast will return the last member in the Group matching the search criteria.
* Group.getFirstNth will return the nth member in the Group, scanning from top to bottom, that matches the search criteria.
* Group.getLastNth will return the nth member in the Group, scanning in reverse, that matches the search criteria.
* Group.remove has a new optional argument `destroyChild` that will call `destroy` on the child after removing it.
* Group.clear has a new optional argument `destroyChild` that will call `destroy` on all children in the Group after removing them.
### Updates
* Impact Physics Game Objects have changed `setLite` to `setLiteCollision`.
* Impact Physics Game Objects have changed `setPassive` to `setPassiveCollision`.
* Impact Physics Game Objects have changed `setFixed` to `setFixedCollision`.
* Impact Physics Game Objects have changed `setActive` to `setActiveCollision`, previously the `setActive` collision method was overwriting the Game Objects `setActive` method, hence the renaming.
* The modifications made to the RTree class in Phaser 3.4.0 to avoid CSP policy violations caused a significant performance hit once a substantial number of bodies were involved. We have recoded how the class deals with its accessor formats and returned to 3.3 level performance while still maintaining CSP policy adherence. Fix #3594 (thanks @16patsle)
* The Retro Font namespace has changed to `Phaser.GameObjects.RetroFont`. Previously, you would access the parser and constants via `BitmapText`, i.e.: `Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET6`. This has now changed to its own namespace, so the same line would be: `Phaser.GameObjects.RetroFont.TEXT_SET6`. The Parser is available via `Phaser.GameObjects.RetroFont.Parse`. This keeps things cleaner and also unbinds RetroFont from BitmapText, allowing you to cleanly exclude it from your build should you wish. All examples have been updated to reflect this.
* If using the `removeFromScene` option in Group.remove or Group.clear it will remove the child/ren from the Scene to which they belong, not the Scene the Group belongs to.
### Bug Fixes
* Fixed a bug that caused data to not be passed to another Scene if you used a transition to start it. Fix #3586 (thanks @willywu)
* Group.getHandler would return any member of the Group, regardless of the state, causing pools to remain fixed at once member. Fix #3592 (thanks @samme)
### 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:
@Fabadiculous @Antriel
## Version 3.5.1 - Kirito - 17th April 2018
### Updates
* The change made in 3.5.0 with how the Scene systems lifecycle is handled has been tweaked. When a Scene is instantiated it will now emit a boot event, as before, and Systems that need it will listen for this event and set-up their internal properties as required. They'll also do the same under the 'start' event, allowing them to restart properly once shutdown. In 3.5 if a Scene was previously not launched or started you wouldn't be able to access all of its internal systems fully, but in 3.5.1 you can.
### Bug Fixes
* LoaderPlugin.destroy would try and remove an incorrect event listener.
* TileSprites would try to call `deleteTexture` on both renderers, but it's only available in WebGL (thanks @jmcriat)
* Using a geometry mask stopped working in WebGL. Fix #3582 (thanks @rafelsanso)
* The particle emitter incorrectly adjusted the vertex count, causing WebGL rendering issues. Fix #3583 (thanks @murteira)
### 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:
@NemoStein @gabegordon @gazpachu @samme @cristlee @melissaelopez @dazigemm @tgrajewski
## Version 3.5.0 - Kirito - 16th April 2018
### Changes to Cameras
@ -45,6 +120,8 @@ Please see the complete JSDocs for the ScenePlugin for more details, as well as
* Group.remove didn't check if the passed Game Object was already a member of the group and would call `removeCallback` and (if specified) `destroy` in any case. Now it does nothing if the Game Object isn't a member of the group (thanks @samme)
* If a Group size exceeded `maxSize` (which can happen if you reduce maxSize beneath the current size), `isFull` would return false and the group could continue to grow. Now `isFull` returns true in that case (thanks @samme)
* Camera.fadeIn following a fadeOut wouldn't work, but is now fixed as a result of the Camera effects rewrite. Fix #3527 (thanks @Jerenaux)
* Particle Emitters with large volumes of particles would throw the error `GL_INVALID_OPERATION: Vertex buffer is not big enough for the draw call` in WebGL.
* Fixed issue with Game.destroy not working correctly under WebGL since 3.4. Fix #3569 (thanks @Huararanga)
### Updates
@ -53,12 +130,14 @@ Please see the complete JSDocs for the ScenePlugin for more details, as well as
* Every Plugin has been updated to correctly follow the same flow through the Scene lifecycle. Instead of listening for the Scene 'boot' event, which is only dispatched once (when the Scene is first created), they will now listen for the Scene 'start' event, which occurs every time the Scene is started. All plugins now consistently follow the same Shutdown and Destroy patterns too, meaning they tidy-up after themselves on a shutdown, not just a destroy. Overall, this change means that there should be less issues when returning to previously closed Scenes, as the plugins will restart themselves properly.
* When shutting down a Scene all Game Objects that belong to the scene will now automatically destroy themselves. They would previously be removed from the display and update lists, but the objects themselves didn't self-destruct. You can control this on a per-object basis with the `ignoreDestroy` property.
* A Matter Mouse Spring will disable debug draw of its constraint by default (you can override it by passing in your own config)
* The RandomDataGenerator class is now exposed under Phaser.Math should you wish to instantiate it yourself. Fix #3576 (thanks @wtravO)
* Refined the Game.destroy sequence, so it will now only destroy the game at the start of the next frame, not during processing.
### 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
@samme @Antriel
## Version 3.4.0 - Miyako - 12th April 2018

187
README.md
View file

@ -24,9 +24,9 @@ Grab the source and join the fun!
<div align="center"><img src="https://phaser.io/images/github/news.jpg"></div>
> 12th April 2018
> 19th April 2018
**Updated:** I'm pleased to announce the immediate release of Phaser 3.4. This is a huge update, bringing lots of fixes and enhancements from the core team and wider community. We've also updated the TypeScript defs to 3.4. As always, please check out the [Change Log](#changelog) for comprehensive details about what this version contains.
**Updated:** We've just released Phaser 3.6.0. This release introduces the full version of Containers, updates more documentation and carries on the update and bug fixing work. It comes shortly after the 3.5 and 3.4 releases which unified the Camera Effects and introduced powerful new Scene Transitions. We appreciate that our current release velocity is extremely high, often with several versions per week, so as always, please check out the [Change Log](#changelog) for comprehensive details about what recent versions contain.
After 1.5 years in the making, tens of thousands of lines of code, hundreds of examples and countless hours of relentless work: Phaser 3 is finally out. It has been a real labor of love and then some!
@ -96,13 +96,13 @@ npm install phaser
[Phaser is on jsDelivr](https://www.jsdelivr.com/projects/phaser) which is a "super-fast CDN for developers". Include the following in your html:
```html
<script src="//cdn.jsdelivr.net/npm/phaser@3.4.0/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.6.0/dist/phaser.js"></script>
```
or the minified version:
```html
<script src="//cdn.jsdelivr.net/npm/phaser@3.4.0/dist/phaser.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.6.0/dist/phaser.min.js"></script>
```
### API Documentation
@ -260,174 +260,37 @@ You can then run `webpack` to create a development build in the `build` folder w
![Change Log](https://phaser.io/images/github/div-change-log.png "Change Log")
<a name="changelog"></a>
## Version 3.4.0 - Miyako - 12th April 2018
## Version 3.6.0 - Asuna - 19th April 2018
### New Features
A beta release of the new Container Game Object arrives in this version. We've flagged it as beta because there are known issues in using Containers in Scenes that have multiple cameras or irregular camera viewports. However, in all other instances we've tested they are operating normally, so we felt it would be best to release them into this build to give developers a chance to get used to them. Using a Container will issue a single console warning as a reminder. We will remove this once they leave beta in a future release. In the meantime they are fully documented and you can find numerous examples in the Phaser 3 Examples repo too.
* A new property was added to Matter.World, `correction` which is used in the Engine.update call and allows you to adjust the time being passed to the simulation. The default value is 1 to remain consistent with previous releases.
* Matter Physics now has a new config property `getDelta` which allows you to specify your own function to calculate the delta value given to the Matter Engine when it updates.
* Matter Physics has two new methods: `set60Hz` and `set30Hz` which will set an Engine update rate of 60Hz and 30Hz respectively. 60Hz being the default.
* Matter Physics has a new config and run-time property `autoUpdate`, which defaults to `true`. When enabled the Matter Engine will update in sync with the game step (set by Request Animation Frame). The delta value given to Matter is now controlled by the `getDelta` function.
* Matter Physics has a new method `step` which manually advances the physics simulation by one iteration, using whatever delta and correction values you pass in to it. When used in combination with `autoUpdate=false` you can now explicitly control the update frequency of the physics simulation and unbind it from the game step.
* Matter Physics has two new debug properties: `debugShowJoint` and `debugJointColor`. If defined they will display joints in Matter bodies during the postUpdate debug phase (only if debug is enabled) (thanks @OmarShehata)
* Group.destroy has a new optional argument `destroyChildren` which will automatically call `destroy` on all children of a Group if set to true (the default is false, hence it doesn't change the public API). Fix #3246 (thanks @DouglasLapsley)
* WebAudioSound.setMute is a chainable way to mute a single Sound instance.
* WebAudioSound.setVolume is a chainable way to set the volume of a single Sound instance.
* WebAudioSound.setSeek is a chainable way to set seek to a point of a single Sound instance.
* WebAudioSound.setLoop is a chainable way to set the loop state of a single Sound instance.
* HTML5AudioSound.setMute is a chainable way to mute a single Sound instance.
* HTML5AudioSound.setVolume is a chainable way to set the volume of a single Sound instance.
* HTML5AudioSound.setSeek is a chainable way to set seek to a point of a single Sound instance.
* HTML5AudioSound.setLoop is a chainable way to set the loop state of a single Sound instance.
* BitmapText has a new property `letterSpacing` which accepts a positive or negative number to add / reduce spacing between characters (thanks @wtravO)
* You can now pass a Sprite Sheet or Canvas as the Texture key to `Tilemap.addTileset` and it will work in WebGL, where-as before it would display a corrupted tilemap. Fix #3407 (thanks @Zykino)
* Graphics.slice allows you to easily draw a Pacman, or slice of pie shape to a Graphics object.
* List.addCallback is a new optional callback that is invoked every time a new child is added to the List. You can use this to have a callback fire when children are added to the Display List.
* List.removeCallback is a new optional callback that is invoked every time a new child is removed from the List. You can use this to have a callback fire when children are removed from the Display List.
* ScenePlugin.restart allows you to restart the current Scene. It's the same result as calling `ScenePlugin.start` without any arguments, but is more clear.
* Utils.Array.Add allows you to add one or more items safely to an array, with optional limits and callbacks.
* Utils.Array.AddAt allows you to add one or more items safely to an array at a specified position, with optional limits and callbacks.
* Utils.Array.BringToTop allows you to bring an array element to the top of the array.
* Utils.Array.CountAllMatching will scan an array and count all elements with properties matching the given value.
* Utils.Array.Each will pass each element of an array to a given callback, with optional arguments.
* Utils.Array.EachInRange will pass each element of an array in a given range to a callback, with optional arguments.
* Utils.Array.GetAll will return all elements from an array, with optional property and value comparisons.
* Utils.Array.GetFirst will return the first element in an array, with optional property and value comparisons.
* Utils.Array.GetRandomElement has been renamed to GetRandom and will return a random element from an array.
* Utils.Array.MoveDown will move the given array element down one position in the array.
* Utils.Array.MoveTo will move the given array element to the given position in the array.
* Utils.Array.MoveUp will move the given array element up one position in the array.
* Utils.Array.Remove will remove the given element or array of elements from the array, with an optional callback.
* Utils.Array.RemoveAt will remove the element from the given position in the array, with an optional callback.
* Utils.Array.RemoveBetween will remove the elements between the given range in the array, with an optional callback.
* Utils.Array.Replace will replace an existing element in an array with a new one.
* Utils.Array.SendToBack allows you to send an array element to the bottom of the array.
* Utils.Array.SetAll will set a property on all elements of an array to the given value, with optional range limits.
* Utils.Array.Swap will swap the position of two elements in an array.
* TransformMatrix.destroy is a new method that will clear out the array and object used by a Matrix internally.
* BaseSound, and by extension WebAudioSound and HTMLAudioSound, will now emit a `destroy` event when they are destroyed (thanks @rexrainbow)
* A new property was added to the Scene config: `mapAdd` which is used to extend the default injection map of a scene instead of overwriting it (thanks @sebashwa)
* GetBounds `getTopLeft`, `getTopRight`, `getBottomLeft` and `getBottomRight` all have a new optional argument `includeParent` which will factor in all ancestor transforms to the returned point.
### Bug Fixes
* In the WebGL Render Texture the tint of the texture was always set to 0xffffff and therefore the alpha values were ignored. The tint is now calculated using the alpha value. Fix #3385 (thanks @ger1995)
* The RenderTexture now uses the ComputedSize component instead of Size (which requires a frame), allowing calls to getBounds to work. Fix #3451 (thanks @kuoruan)
* PathFollower.start has been renamed to `startFollow`, but PathFollower.setPath was still using `PathFollower.start` (thanks @samid737)
* BaseSoundManager.rate and BaseSoundManager.detune would incorrectly called `setRate` on its sounds, instead of `calculateRate`.
* The Gamepad Axis `getValue` method now correctly applies the threshold and zeroes out the returned value.
* The HueToComponent module was not correctly exporting itself. Fix #3482 (thanks @jdotrjs)
* Matter.World was using `setZ` instead of `setDepth` for the Debug Graphics Layer, causing it to appear behind objects in some display lists.
* Game.destroy now checks to see if the `renderer` exists before calling destroy on it. Fix #3498 (thanks @Huararanga)
* Keyboard.JustDown and Keyboard.JustUp were being reset too early, causing them to fail when called in `update` loops. Fix #3490 (thanks @belen-albeza)
* RenderTexture.destroy no longer throws an error when called. Fix #3475 (thanks @kuoruan)
* The WebGL TileSprite batch now modulates the tilePosition to avoid large values being passed into the UV data, fixing corruption when scrolling TileSprites over a long period of time. Fix #3402 (thanks @vinerz @FrancescoNegri)
* LineCurve.getResolution was missing the `divisions` argument and always returning 1, which made it fail when used as part of a Path. It now defaults to return 1 unless specified otherwise (thanks _ok)
* A Game Object enabled for drag would no longer fire over and out events after being dragged, now it does (thanks @jmcriat)
* Line.getPointA and Line.getPointB incorrectly set the values into the Vector2 (thanks @Tomas2h)
* DynamicTilemapLayer now uses the ComputedSize component, which stops it breaking if you call `setDisplaySize` (thanks Babsobar)
* StaticTilemapLayer now uses the ComputedSize component, which stops it breaking if you call `setDisplaySize` (thanks Babsobar)
* CanvasPool.first always returned `null`, and now returns the first available Canvas. Fix #3520 (thanks @mchiasson)
* When starting a new Scene with an optional `data` argument it wouldn't get passed through if the Scene was not yet available (i.e. the game had not fully booted). The data is now passed to the Scene `init` and `create` methods and stored in the Scene Settings `data` property. Fix #3363 (thanks @pixelhijack)
* Tween.restart handles removed tweens properly and reads them back into the active queue for the TweenManager (thanks @wtravO)
* Tween.resume will now call `Tween.play` on a tween that was paused due to its config object, not as a result of having its paused method called. Fix #3452 (thanks @jazen)
* LoaderPlugin.isReady referenced a constant that no longer exists. Fix #3503 (thanks @Twilrom)
* Tween Timeline.destroy was trying to call `destroy` on Tweens instead of `stop` (thanks @Antriel)
* Calling `setOffset` on a Static Arcade Physics Body would break because the method was missing. It has been added and now functions as expected. Fix #3465 (thanks @josephjaniga and @DouglasLapsley)
* Calling Impact.World.remove(body) during a Body.updateCallback would cause the internal loop to crash when trying to access a now missing body. Two extra checks are in place to avoid this (thanks @iamDecode)
* If `setInteractive` is called on a Game Object that fails to set a hit area, it will no longer try to assign `dropZone` to an undefined `input` property.
* The Matter SetBody Component will no longer try to call `setOrigin` unless the Game Object has the origin component (which not all do, like Graphics and Container)
* Matter Image and Matter Sprite didn't define a `destroy` method, causing an error when trying to destroy the parent Game Object. Fix #3516 (thanks @RollinSafary)
* Containers are now fully available! We have removed the beta warning and fixed the way in which they work with Cameras, input and scroll factors. They are also fully documented, so please see their docs and examples for use.
* Group.getLast will return the last member in the Group matching the search criteria.
* Group.getFirstNth will return the nth member in the Group, scanning from top to bottom, that matches the search criteria.
* Group.getLastNth will return the nth member in the Group, scanning in reverse, that matches the search criteria.
* Group.remove has a new optional argument `destroyChild` that will call `destroy` on the child after removing it.
* Group.clear has a new optional argument `destroyChild` that will call `destroy` on all children in the Group after removing them.
### Updates
* The RTree library (rbush) used by Phaser 3 suffered from violating CSP policies by dynamically creating Functions at run-time in an eval-like manner. These are now defined via generators. Fix #3441 (thanks @jamierocks @Colbydude @jdotrjs)
* BaseSound has had its `rate` and `detune` properties removed as they are always set in the overriding class.
* BaseSound `setRate` and `setDetune` from the 3.4.0 release have moved to the WebAudioSound and HTML5AudioSound classes respectively, as they each handle the values differently.
* The file `InteractiveObject.js` has been renamed to `CreateInteractiveObject.js` to more accurately reflect what it does and to avoid type errors in the docs.
* Renamed the Camera Controls module exports for `Fixed` to `FixedKeyControl` and `Smoothed` to `SmoothedKeyControl` to match the class names. Fix #3463 (thanks @seivan)
* The ComputedSize Component now has `setSize` and `setDisplaySize` methods. This component is used for Game Objects that have a non-texture based size.
* The GamepadManager now extends EventEmitter directly, just like the KeyboardManager does.
* The Gamepad Axis threshold has been increased from 0.05 to 0.1.
* Utils.Array.FindClosestInSorted has a new optional argument `key` which will allow you to scan a top-level property of any object in the given sorted array and get the closest match to it.
* Vector2.setTo is a method alias for Vector2.set allowing it to be used inter-changeably with Geom.Point.
* List.add can now take an array or a single child. If an array is given it's passed over to List.addMultiple.
* List.add has a new optional argument `skipCallback`.
* List.addAt has a new optional argument `skipCallback`.
* List.addMultiple has a new optional argument `skipCallback`.
* List.remove has a new optional argument `skipCallback`.
* List.removeAt has a new optional argument `skipCallback`.
* List.removeBetween has a new optional argument `skipCallback`.
* List.removeAll has a new optional argument `skipCallback`.
* When using the `extend` property of a Scene config object it will now block overwriting the Scene `sys` property.
* When using the `extend` property of a Scene config object, if you define a property called `data` that has an object set, it will populate the Scenes Data Manager with those values.
* SceneManager._processing has been renamed to `isProcessing` which is now a boolean, not an integer. It's also now public and read-only.
* SceneManager.isBooted is a new boolean read-only property that lets you know if the Scene Manager has performed its initial boot sequence.
* TransformMatrix has the following new getter and setters: `a`, `b`, `c`, `d`, `tx` and `ty`. It also has the following new getters: `scaleX`, `scaleY` and `rotation`.
* List.getByKey has been removed. Use `List.getFirst` instead which offers the exact same functionality.
* List.sortIndexHandler has been removed because it's no longer required.
* List.sort no longer takes an array as its argument, instead it only sorts the List contents by the defined property.
* List.addMultiple has been removed. Used `List.add` instead which offers the exact same functionality.
* List is now internally using all of the new Utils.Array functions.
* Rectangle.Union will now cache all vars internally so you can use one of the input rectangles as the output rectangle without corrupting it.
* When shutting down a Matter World it will now call MatterEvents.off, clearing all events, and also `removeAllListeners` for any local events.
* Removed InputPlugin.sortInteractiveObjects because the method isn't used anywhere internally.
* Impact Physics Game Objects have changed `setLite` to `setLiteCollision`.
* Impact Physics Game Objects have changed `setPassive` to `setPassiveCollision`.
* Impact Physics Game Objects have changed `setFixed` to `setFixedCollision`.
* Impact Physics Game Objects have changed `setActive` to `setActiveCollision`, previously the `setActive` collision method was overwriting the Game Objects `setActive` method, hence the renaming.
* The modifications made to the RTree class in Phaser 3.4.0 to avoid CSP policy violations caused a significant performance hit once a substantial number of bodies were involved. We have recoded how the class deals with its accessor formats and returned to 3.3 level performance while still maintaining CSP policy adherence. Fix #3594 (thanks @16patsle)
* The Retro Font namespace has changed to `Phaser.GameObjects.RetroFont`. Previously, you would access the parser and constants via `BitmapText`, i.e.: `Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET6`. This has now changed to its own namespace, so the same line would be: `Phaser.GameObjects.RetroFont.TEXT_SET6`. The Parser is available via `Phaser.GameObjects.RetroFont.Parse`. This keeps things cleaner and also unbinds RetroFont from BitmapText, allowing you to cleanly exclude it from your build should you wish. All examples have been updated to reflect this.
* If using the `removeFromScene` option in Group.remove or Group.clear it will remove the child/ren from the Scene to which they belong, not the Scene the Group belongs to.
### Animation System Updates
### Bug Fixes
We have refactored the Animation API to make it more consistent with the rest of Phaser 3 and to fix some issues. All of the following changes apply to the Animation Component:
* Animation durations, delays and repeatDelays are all now specified in milliseconds, not seconds like before. This makes them consistent with Tweens, Sounds and other parts of v3. You can still use the `frameRate` property to set the speed of an animation in frames per second.
* All of the Animation callbacks have been removed, including `onStart`, `onRepeat`, `onUpdate` and `onComplete` and the corresponding params arrays like `onStartParams` and the property `callbackScope`. The reason for this is that they were all set on a global level, meaning that if you had 100 Sprites sharing the same animation, it was impossible to set the callbacks to fire for just one of those Sprites, but instead they would fire for all 100 and it was up to you to figure out which Sprite you wanted to update. Instead of callbacks animations now dispatch events on the Game Objects in which they are running. This means you can now do `sprite.on('animationstart')` and it will be invoked at the same point the old `onStart` callback would have been. The new events are: `animationstart`, `animtionrepeat`, `animationupdate` and `animationcomplete`. They're all dispatched from the Game Object that has the animation playing, not from the animation itself. This allows you far more control over what happens in the callbacks and we believe generally makes them more useful.
* The AnimationFrame.onUpdate callback has been removed. You can now use the `animationupdate` event dispatched from the Game Object itself and check the 2nd argument, which is the animation frame.
* Animation.stopAfterDelay is a new method that will stop a Sprites animation after the given time in ms.
* Animation.stopOnRepeat is a new method that will stop a Sprites animation when it goes to repeat.
* Animation.stopOnFrame is a new method that will stop a Sprites animation when it sets the given frame.
* Animation.stop no longer has the `dispatchCallbacks` argument, because it dispatches an event which you can choose to ignore.
* `delay` method has been removed.
* `setDelay` allows you to define the delay before playback begins.
* `getDelay` returns the animation playback delay value.
* `delayedPlay` now returns the parent Game Object instead of the component.
* `load` now returns the parent Game Object instead of the component.
* `pause` now returns the parent Game Object instead of the component.
* `resume` now returns the parent Game Object instead of the component.
* `isPaused` returns a boolean indicating the paused state of the animation.
* `paused` method has been removed.
* `play` now returns the parent Game Object instead of the component.
* `progress` method has been removed.
* `getProgress` returns the animation progress value.
* `setProgress` lets you jump the animation to a specific progress point.
* `repeat` method has been removed.
* `getRepeat` returns the animation repeat value.
* `setRepeat` sets the number of times the current animation will repeat.
* `repeatDelay` method has been removed.
* `getRepeatDelay` returns the animation repeat delay value.
* `setRepeatDelay` sets the delay time between each repeat.
* `restart` now returns the parent Game Object instead of the component.
* `stop` now returns the parent Game Object instead of the component.
* `timeScale` method has been removed.
* `getTimeScale` returns the animation time scale value.
* `setTimeScale` sets the time scale value.
* `totalFrames` method has been removed.
* `getTotalFrames` returns the total number of frames in the animation.
* `totalProgres` method has been removed as it did nothing and was mis-spelt.
* `yoyo` method has been removed.
* `getYoyo` returns if the animation will yoyo or not.
* `setYoyo` sets if the animation will yoyo or not.
* `updateFrame` will now call `setSizeToFrame` on the Game Object, which will adjust the Game Objects `width` and `height` properties to match the frame size. Fix #3473 (thanks @wtravO @jp-gc)
* `updateFrame` now supports animation frames with custom pivot points and injects these into the Game Object origin.
* `destroy` now removes events, references to the Animation Manager and parent Game Object, clears the current animation and frame and empties internal arrays.
* Changing the `yoyo` property on an Animation Component would have no effect as it only ever checked the global property, it now checks the local one properly allowing you to specify a `yoyo` on a per Game Object basis.
* Animation.destroy now properly clears the global animation object.
* Animation.getFrameByProgress will return the Animation Frame that is closest to the given progress value. For example, in a 5 frame animation calling this method with a value of 0.5 would return the middle frame.
* Fixed a bug that caused data to not be passed to another Scene if you used a transition to start it. Fix #3586 (thanks @willywu)
* Group.getHandler would return any member of the Group, regardless of the state, causing pools to remain fixed at once member. Fix #3592 (thanks @samme)
### 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:
@gabegordon @melissaelopez @samid737 @nbs @tgrajewski @pagesrichie @hexus @mbrickn @erd0s @icbat @Matthew-Herman @ampled @mkimmet @PaNaVTEC
@Fabadiculous @Antriel
Please see the complete [Change Log](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md) for previous releases.
@ -460,8 +323,8 @@ All rights reserved.
"Above all, video games are meant to be just one thing: fun. Fun for everyone." - Satoru Iwata
[get-js]: https://github.com/photonstorm/phaser/releases/download/v3.4.0/phaser.js
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v3.4.0/phaser.min.js
[get-js]: https://github.com/photonstorm/phaser/releases/download/v3.6.0/phaser.js
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v3.6.0/phaser.min.js
[clone-http]: https://github.com/photonstorm/phaser.git
[clone-ssh]: git@github.com:photonstorm/phaser.git
[clone-ghwin]: github-windows://openRepo/https://github.com/photonstorm/phaser
@ -470,4 +333,4 @@ All rights reserved.
[issues]: https://github.com/photonstorm/phaser/issues
[examples]: https://github.com/photonstorm/phaser3-examples
[contribute]: https://github.com/photonstorm/phaser/blob/master/.github/CONTRIBUTING.md
[forum]: http://www.html5gamedevs.com/forum/14-phaser/
[forum]: http://www.html5gamedevs.com/forum/33-phaser-3/

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

70920
dist/phaser-core.js vendored Normal file

File diff suppressed because it is too large Load diff

1
dist/phaser-core.min.js vendored Normal file

File diff suppressed because one or more lines are too long

134845
dist/phaser.js vendored

File diff suppressed because it is too large Load diff

2
dist/phaser.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
{
"name": "phaser",
"version": "3.5.0",
"release": "Miyako",
"version": "3.6.1",
"release": "Asuna",
"description": "A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.",
"author": "Richard Davey <rich@photonstorm.com> (http://www.photonstorm.com)",
"logo": "https://raw.github.com/photonstorm/phaser/master/phaser-logo-small.png",

View file

@ -5,7 +5,7 @@
*/
/**
* [description]
* Play an animation with the given key, starting at the given startFrame on all Game Objects in items.
*
* @function Phaser.Actions.PlayAnimation
* @since 3.0.0
@ -13,8 +13,8 @@
* @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]
*
* @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.
* @param {string} key - [description]
* @param {(string|integer)} [startFrame] - [description]
* @param {string} key - The name of the animation to play.
* @param {(string|integer)} [startFrame] - The starting frame of the animation with the given key.
*
* @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.
*/

View file

@ -13,7 +13,7 @@ var GetValue = require('../utils/object/GetValue');
/**
* @typedef {object} JSONAnimation
*
* @property {string} key - [description]
* @property {string} key - The key that the animation will be associated with. i.e. sprite.animations.play(key)
* @property {string} type - A frame based animation (as opposed to a bone based animation)
* @property {JSONAnimationFrame[]} frames - [description]
* @property {integer} frameRate - The frame rate of playback in frames per second (default 24 if duration is null)
@ -30,7 +30,7 @@ var GetValue = require('../utils/object/GetValue');
/**
* @typedef {object} AnimationFrameConfig
*
* @property {string} key - [description]
* @property {string} key - The key that the animation will be associated with. i.e. sprite.animations.play(key)
* @property {(string|number)} frame - [description]
* @property {float} [duration=0] - [description]
* @property {boolean} [visible] - [description]
@ -39,8 +39,9 @@ var GetValue = require('../utils/object/GetValue');
/**
* @typedef {object} AnimationConfig
*
* @property {AnimationFrameConfig[]} [frames] - [description]
* @property {string} [defaultTextureKey=null] - [description]
* @property {string} [key] - The key that the animation will be associated with. i.e. sprite.animations.play(key)
* @property {AnimationFrameConfig[]} [frames] - An object containing data used to generate the frames for the animation
* @property {string} [defaultTextureKey=null] - The key of the texture all frames of the animation will use. Can be overridden on a per frame basis.
* @property {integer} [frameRate] - The frame rate of playback in frames per second (default 24 if duration is null)
* @property {integer} [duration] - How long the animation should play for in milliseconds. If not given its derived from frameRate.
* @property {boolean} [skipMissedFrames=true] - Skip frames if the time lags, or always advanced anyway?
@ -78,7 +79,7 @@ var Animation = new Class({
function Animation (manager, key, config)
{
/**
* [description]
* A reference to the global Animation Manager
*
* @name Phaser.Animations.Animation#manager
* @type {Phaser.Animations.AnimationManager}
@ -87,7 +88,7 @@ var Animation = new Class({
this.manager = manager;
/**
* [description]
* The unique identifying string for this animation
*
* @name Phaser.Animations.Animation#key
* @type {string}
@ -366,15 +367,15 @@ var Animation = new Class({
},
/**
* [description]
* Returns the AnimationFrame at the provided index
*
* @method Phaser.Animations.Animation#getFrameAt
* @protected
* @since 3.0.0
*
* @param {integer} index - [description]
* @param {integer} index - The index in the AnimationFrame array
*
* @return {Phaser.Animations.AnimationFrame} [description]
* @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence
*/
getFrameAt: function (index)
{
@ -660,12 +661,13 @@ var Animation = new Class({
},
/**
* [description]
* Removes a frame from the AnimationFrame array at the provided index
* and updates the animation accordingly.
*
* @method Phaser.Animations.Animation#removeFrameAt
* @since 3.0.0
*
* @param {integer} index - [description]
* @param {integer} index - The index in the AnimationFrame array
*
* @return {Phaser.Animations.Animation} This Animation object.
*/

View file

@ -229,6 +229,18 @@ var AnimationManager = new Class({
return output;
},
/**
* @typedef {object} GenerateFrameNamesConfig
*
* @property {string} [prefix=''] - [description]
* @property {integer} [start=0] - [description]
* @property {integer} [end=0] - [description]
* @property {string} [suffix=''] - [description]
* @property {integer} [zeroPad=0] - [description]
* @property {AnimationFrameConfig[]} [outputArray=[]] - [description]
* @property {boolean} [frames=false] - [description]
*/
/**
* [description]
*
@ -236,14 +248,7 @@ var AnimationManager = new Class({
* @since 3.0.0
*
* @param {string} key - [description]
* @param {object} config - [description]
* @param {string} [config.prefix=''] - [description]
* @param {integer} [config.start=0] - [description]
* @param {integer} [config.end=0] - [description]
* @param {string} [config.suffix=''] - [description]
* @param {integer} [config.zeroPad=0] - [description]
* @param {AnimationFrameConfig[]} [config.outputArray=[]] - [description]
* @param {boolean} [config.frames=false] - [description]
* @param {GenerateFrameNamesConfig} config - [description]
*
* @return {AnimationFrameConfig[]} [description]
*/
@ -301,6 +306,16 @@ var AnimationManager = new Class({
return out;
},
/**
* @typedef {object} GenerateFrameNumbersConfig
*
* @property {integer} [start=0] - [description]
* @property {integer} [end=-1] - [description]
* @property {boolean} [first=false] - [description]
* @property {AnimationFrameConfig[]} [outputArray=[]] - [description]
* @property {boolean} [frames=false] - [description]
*/
/**
* [description]
*
@ -308,12 +323,7 @@ var AnimationManager = new Class({
* @since 3.0.0
*
* @param {string} key - [description]
* @param {object} config - [description]
* @param {integer} [config.start=0] - [description]
* @param {integer} [config.end=-1] - [description]
* @param {boolean} [config.first=false] - [description]
* @param {AnimationFrameConfig[]} [config.outputArray=[]] - [description]
* @param {boolean} [config.frames=false] - [description]
* @param {GenerateFrameNumbersConfig} config - [description]
*
* @return {AnimationFrameConfig[]} [description]
*/

View file

@ -91,7 +91,7 @@ var CreateRenderer = function (game)
var CanvasRenderer;
var WebGLRenderer;
if (WEBGL_RENDERER && CANVAS_RENDERER)
if (typeof WEBGL_RENDERER && typeof CANVAS_RENDERER)
{
CanvasRenderer = require('../renderer/canvas/CanvasRenderer');
WebGLRenderer = require('../renderer/webgl/WebGLRenderer');
@ -109,7 +109,7 @@ var CreateRenderer = function (game)
}
}
if (WEBGL_RENDERER && !CANVAS_RENDERER)
if (typeof WEBGL_RENDERER && !typeof CANVAS_RENDERER)
{
WebGLRenderer = require('../renderer/webgl/WebGLRenderer');
@ -119,7 +119,7 @@ var CreateRenderer = function (game)
game.context = null;
}
if (!WEBGL_RENDERER && CANVAS_RENDERER)
if (!typeof WEBGL_RENDERER && typeof CANVAS_RENDERER)
{
CanvasRenderer = require('../renderer/canvas/CanvasRenderer');

View file

@ -242,6 +242,26 @@ var Game = new Class({
*/
this.onStepCallback = NOOP;
/**
* Is this Game pending destruction at the start of the next frame?
*
* @name Phaser.Game#pendingDestroy
* @type {boolean}
* @private
* @since 3.5.0
*/
this.pendingDestroy = false;
/**
* Remove the Canvas once the destroy is over?
*
* @name Phaser.Game#removeCanvas
* @type {boolean}
* @private
* @since 3.5.0
*/
this.removeCanvas = false;
// Wait for the DOM Ready event, then call boot.
DOMContentLoaded(this.boot.bind(this));
},
@ -354,6 +374,11 @@ var Game = new Class({
*/
step: function (time, delta)
{
if (this.pendingDestroy)
{
return this.runDestroy();
}
// Global Managers
this.input.update(time, delta);
@ -527,14 +552,33 @@ var Game = new Class({
},
/**
* Destroys this Phaser.Game instance, all global systems, all sub-systems and all Scenes.
* Flags this Game instance as needing to be destroyed on the next frame.
* It will wait until the current frame has completed and then call `runDestroy` internally.
*
* @method Phaser.Game#destroy
* @since 3.0.0
*
* @param {boolean} removeCanvas - Set to `true` if you would like the parent canvas element removed from the DOM, or `false` to leave it in place.
*/
destroy: function (removeCanvas)
{
this.loop.destroy();
this.pendingDestroy = true;
this.removeCanvas = removeCanvas;
},
/**
* Destroys this Phaser.Game instance, all global systems, all sub-systems and all Scenes.
*
* @method Phaser.Game#runDestroy
* @private
* @since 3.5.0
*/
runDestroy: function ()
{
this.events.emit('destroy');
this.events.removeAllListeners();
this.scene.destroy();
@ -543,16 +587,21 @@ var Game = new Class({
this.renderer.destroy();
}
this.events.emit('destroy');
this.events.removeAllListeners();
this.onStepCallback = null;
if (removeCanvas && this.canvas)
if (this.removeCanvas && this.canvas)
{
CanvasPool.remove(this.canvas);
if (this.canvas.parentNode)
{
this.canvas.parentNode.removeChild(this.canvas);
}
}
this.loop.destroy();
this.pendingDestroy = false;
}
});

View file

@ -161,7 +161,7 @@ var PluginManager = new Class({
* Plugin is the object to instantiate to create the plugin
* Mapping is what the plugin is injected into the Scene.Systems as (i.e. input)
*
* @method PluginManager.register
* @method Phaser.Boot.PluginManager.register
* @since 3.0.0
*
* @param {string} key - [description]

View file

@ -49,7 +49,8 @@ var TimeStep = new Class({
/**
* A reference to the Phaser.Game instance.
*
* @property {Phaser.Game} game
* @name Phaser.Boot.TimeStep#game
* @type {Phaser.Game}
* @readOnly
* @since 3.0.0
*/
@ -58,7 +59,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {Phaser.DOM.RequestAnimationFrame} raf
* @name Phaser.Boot.TimeStep#raf
* @type {Phaser.DOM.RequestAnimationFrame}
* @readOnly
* @since 3.0.0
*/
@ -67,7 +69,8 @@ var TimeStep = new Class({
/**
* A flag that is set once the TimeStep has started running and toggled when it stops.
*
* @property {boolean} started
* @name Phaser.Boot.TimeStep#started
* @type {boolean}
* @readOnly
* @default false
* @since 3.0.0
@ -80,7 +83,8 @@ var TimeStep = new Class({
* the TimeStep is sent to sleep, where-as `started` remains `true`, only changing if
* the TimeStep is actually stopped, not just paused.
*
* @property {boolean} running
* @name Phaser.Boot.TimeStep#running
* @type {boolean}
* @readOnly
* @default false
* @since 3.0.0
@ -90,7 +94,8 @@ var TimeStep = new Class({
/**
* The minimum fps rate you want the Time Step to run at.
*
* @property {integer} minFps
* @name Phaser.Boot.TimeStep#minFps
* @type {integer}
* @default 5
* @since 3.0.0
*/
@ -103,7 +108,8 @@ var TimeStep = new Class({
* the control of Phaser. Instead, it allows you to determine performance issues and if the Time Step
* is spiraling out of control.
*
* @property {integer} targetFps
* @name Phaser.Boot.TimeStep#targetFps
* @type {integer}
* @default 60
* @since 3.0.0
*/
@ -113,7 +119,8 @@ var TimeStep = new Class({
* The minFps value in ms.
* Defaults to 200ms between frames (i.e. super slow!)
*
* @property {number} _min
* @name Phaser.Boot.TimeStep#_min
* @type {number}
* @private
* @since 3.0.0
*/
@ -123,7 +130,8 @@ var TimeStep = new Class({
* The targetFps value in ms.
* Defaults to 16.66ms between frames (i.e. normal)
*
* @property {number} _target
* @name Phaser.Boot.TimeStep#_target
* @type {number}
* @private
* @since 3.0.0
*/
@ -132,7 +140,8 @@ var TimeStep = new Class({
/**
* An exponential moving average of the frames per second.
*
* @property {integer} actualFps
* @name Phaser.Boot.TimeStep#actualFps
* @type {integer}
* @readOnly
* @default 60
* @since 3.0.0
@ -142,7 +151,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} nextFpsUpdate
* @name Phaser.Boot.TimeStep#nextFpsUpdate
* @type {integer}
* @readOnly
* @default 0
* @since 3.0.0
@ -152,7 +162,8 @@ var TimeStep = new Class({
/**
* The number of frames processed this second.
*
* @property {integer} framesThisSecond
* @name Phaser.Boot.TimeStep#framesThisSecond
* @type {integer}
* @readOnly
* @default 0
* @since 3.0.0
@ -162,7 +173,8 @@ var TimeStep = new Class({
/**
* A callback to be invoked each time the Time Step steps.
*
* @property {TimeStepCallback} callback
* @name Phaser.Boot.TimeStep#callback
* @type {TimeStepCallback}
* @default NOOP
* @since 3.0.0
*/
@ -172,7 +184,8 @@ var TimeStep = new Class({
* You can force the Time Step to use Set Timeout instead of Request Animation Frame by setting
* the `forceSetTimeOut` property to `true` in the Game Configuration object. It cannot be changed at run-time.
*
* @property {boolean} forceSetTimeOut
* @name Phaser.Boot.TimeStep#forceSetTimeOut
* @type {boolean}
* @readOnly
* @default false
* @since 3.0.0
@ -182,7 +195,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} time
* @name Phaser.Boot.TimeStep#time
* @type {integer}
* @default 0
* @since 3.0.0
*/
@ -191,7 +205,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} startTime
* @name Phaser.Boot.TimeStep#startTime
* @type {integer}
* @default 0
* @since 3.0.0
*/
@ -200,7 +215,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} lastTime
* @name Phaser.Boot.TimeStep#lastTime
* @type {integer}
* @default 0
* @since 3.0.0
*/
@ -209,7 +225,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} frame
* @name Phaser.Boot.TimeStep#frame
* @type {integer}
* @readOnly
* @default 0
* @since 3.0.0
@ -219,7 +236,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {boolean} inFocus
* @name Phaser.Boot.TimeStep#inFocus
* @type {boolean}
* @readOnly
* @default true
* @since 3.0.0
@ -229,7 +247,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} _pauseTime
* @name Phaser.Boot.TimeStep#_pauseTime
* @type {integer}
* @private
* @default 0
* @since 3.0.0
@ -239,7 +258,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} _coolDown
* @name Phaser.Boot.TimeStep#_coolDown
* @type {integer}
* @private
* @default 0
* @since 3.0.0
@ -249,7 +269,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} delta
* @name Phaser.Boot.TimeStep#delta
* @type {integer}
* @default 0
* @since 3.0.0
*/
@ -258,7 +279,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} deltaIndex
* @name Phaser.Boot.TimeStep#deltaIndex
* @type {integer}
* @default 0
* @since 3.0.0
*/
@ -267,7 +289,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {array} deltaHistory
* @name Phaser.Boot.TimeStep#deltaHistory
* @type {array}
* @default 0
* @since 3.0.0
*/
@ -276,7 +299,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} deltaSmoothingMax
* @name Phaser.Boot.TimeStep#deltaSmoothingMax
* @type {integer}
* @default 10
* @since 3.0.0
*/
@ -285,7 +309,8 @@ var TimeStep = new Class({
/**
* [description]
*
* @property {integer} panicMax
* @name Phaser.Boot.TimeStep#panicMax
* @type {integer}
* @default 120
* @since 3.0.0
*/
@ -296,7 +321,8 @@ var TimeStep = new Class({
* Unlike with `delta` no smoothing, capping, or averaging is applied to this value.
* So please be careful when using this value in calculations.
*
* @property {number} rawDelta
* @name Phaser.Boot.TimeStep#rawDelta
* @type {number}
* @default 0
* @since 3.0.0
*/

View file

@ -1145,14 +1145,13 @@ var Camera = new Class({
*/
/**
* Destroys this Camera instance.
* Destroys this Camera instance. You rarely need to call this directly.
*
* Called by the Camera Manager. If you wish to destroy a Camera please use `CameraManager.remove` as
* cameras are stored in a pool, ready for recycling later, and calling this directly will prevent that.
*
* @method Phaser.Cameras.Scene2D.Camera#destroy
* @fires CameraDestroyEvent
* @protected
* @since 3.0.0
*/
destroy: function ()

View file

@ -113,19 +113,19 @@ var CameraManager = new Class({
*/
this.baseScale = 1;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Cameras.Scene2D.CameraManager#start
* @method Phaser.Cameras.Scene2D.CameraManager#boot
* @private
* @since 3.5.0
* @since 3.5.1
*/
start: function ()
boot: function ()
{
var sys = this.systems;
@ -142,11 +142,29 @@ var CameraManager = new Class({
this.main = this.cameras[0];
var eventEmitter = sys.events;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
* Do not invoke it directly.
*
* @method Phaser.Cameras.Scene2D.CameraManager#start
* @private
* @since 3.5.0
*/
start: function ()
{
if (!this.main)
{
this.boot();
}
var eventEmitter = this.systems.events;
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**

View file

@ -348,7 +348,7 @@ var Fade = new Class({
* @method Phaser.Cameras.Scene2D.Effects.Fade#postRenderWebGL
* @since 3.5.0
*
* @param {Phaser.Renderer.WebGL.WebGLPipeline.FlatTintPipeline} pipeline - The WebGL Pipeline to render to.
* @param {Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline} pipeline - The WebGL Pipeline to render to.
* @param {function} getTintFunction - A function that will return the gl safe tint colors.
*
* @return {boolean} `true` if the effect drew to the renderer, otherwise `false`.

View file

@ -295,7 +295,7 @@ var Flash = new Class({
* @method Phaser.Cameras.Scene2D.Effects.Flash#postRenderWebGL
* @since 3.5.0
*
* @param {Phaser.Renderer.WebGL.WebGLPipeline.FlatTintPipeline} pipeline - The WebGL Pipeline to render to.
* @param {Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline} pipeline - The WebGL Pipeline to render to.
* @param {function} getTintFunction - A function that will return the gl safe tint colors.
*
* @return {boolean} `true` if the effect drew to the renderer, otherwise `false`.

View file

@ -53,9 +53,24 @@ var CameraManager = new Class({
*/
this.cameras = [];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Cameras.Scene3D.CameraManager#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -71,7 +86,6 @@ var CameraManager = new Class({
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**

View file

@ -20,7 +20,7 @@ var CONST = {
* @type {string}
* @since 3.0.0
*/
VERSION: '3.5.0-beta',
VERSION: '3.6.1',
BlendModes: require('./renderer/BlendModes'),

View file

@ -146,7 +146,7 @@ var CubicBezierCurve = new Class({
* @method Phaser.Curves.CubicBezierCurve#draw
* @since 3.0.0
*
* @generic {Phaser.GameObjects.Graphics} G - [out,$return]
* @generic {Phaser.GameObjects.Graphics} G - [graphics,$return]
*
* @param {Phaser.GameObjects.Graphics} graphics - [description]
* @param {integer} [pointsTotal=32] - [description]

View file

@ -117,7 +117,7 @@ var Curve = new Class({
* @method Phaser.Curves.Curve#draw
* @since 3.0.0
*
* @generic {Phaser.GameObjects.Graphics} G - [out,$return]
* @generic {Phaser.GameObjects.Graphics} G - [graphics,$return]
*
* @param {Phaser.GameObjects.Graphics} graphics - The Graphics instance onto which this curve will be drawn.
* @param {integer} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance.

View file

@ -96,7 +96,7 @@ var EllipseCurve = new Class({
/**
* [description]
*
* @name {Phaser.Curves.EllipseCurve#p0
* @name Phaser.Curves.EllipseCurve#p0
* @type {Phaser.Math.Vector2}
* @since 3.0.0
*/

View file

@ -56,7 +56,7 @@ var LineCurve = new Class({
/**
* [description]
*
* @property Phaser.Curves.LineCurve#p1
* @name Phaser.Curves.LineCurve#p1
* @type {Phaser.Math.Vector2}
* @since 3.0.0
*/
@ -170,6 +170,8 @@ var LineCurve = new Class({
*
* @method Phaser.Curves.LineCurve#getTangent
* @since 3.0.0
*
* @generic {Phaser.Math.Vector2} O - [out,$return]
*
* @return {Phaser.Math.Vector2} [description]
*/

View file

@ -91,7 +91,7 @@ var Path = new Class({
/**
* [description]
*
* @name {Phaser.Curves.Path#startPoint
* @name Phaser.Curves.Path#startPoint
* @type {Phaser.Math.Vector2}
* @since 3.0.0
*/
@ -100,7 +100,7 @@ var Path = new Class({
/**
* [description]
*
* @name {Phaser.Curves.Path#_tmpVec2A
* @name Phaser.Curves.Path#_tmpVec2A
* @type {Phaser.Math.Vector2}
* @private
* @since 3.0.0
@ -110,7 +110,7 @@ var Path = new Class({
/**
* [description]
*
* @name {Phaser.Curves.Path#_tmpVec2B
* @name Phaser.Curves.Path#_tmpVec2B
* @type {Phaser.Math.Vector2}
* @private
* @since 3.0.0

View file

@ -92,7 +92,7 @@ var DataManager = new Class({
*/
this._frozen = false;
if (this.events)
if (!parent.hasOwnProperty('sys') && this.events)
{
this.events.once('destroy', this.destroy, this);
}

View file

@ -50,9 +50,25 @@ var DataManagerPlugin = new Class({
*/
this.systems = scene.sys;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Data.DataManagerPlugin#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.events = this.systems.events;
this.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -64,17 +80,7 @@ var DataManagerPlugin = new Class({
*/
start: function ()
{
if (this.events)
{
this.events.off('destroy', this.destroy, this);
}
this.events = this.systems.events;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.events.once('shutdown', this.shutdown, this);
},
/**
@ -87,9 +93,7 @@ var DataManagerPlugin = new Class({
*/
shutdown: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -103,7 +107,7 @@ var DataManagerPlugin = new Class({
{
DataManager.prototype.destroy.call(this);
this.systems.events.off('start', this.start, this);
this.events.off('start', this.start, this);
this.scene = null;
this.systems = null;

View file

@ -14,12 +14,12 @@ var pool = [];
var _disableContextSmoothing = false;
/**
* The CanvasPool is a global static object, that allows Phaser to recycle and pool Canvas DOM elements.
* The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements.
* It does not pool WebGL Contexts, because once the context options are set they cannot be modified again,
* which is useless for some of the Phaser pipelines / renderer.
*
* This singleton is instantiated as soon as Phaser loads,
* before a Phaser.Game instance has even been created.
* Which means all instances of Phaser Games on the same page
* can share the one single pool
* This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created.
* Which means all instances of Phaser Games on the same page can share the one single pool.
*
* @namespace Phaser.Display.Canvas.CanvasPool
* @since 3.0.0
@ -56,7 +56,10 @@ var CanvasPool = function ()
type: canvasType
};
pool.push(container);
if (canvasType === CONST.CANVAS)
{
pool.push(container);
}
canvas = container.canvas;
}
@ -126,6 +129,11 @@ var CanvasPool = function ()
{
if (canvasType === undefined) { canvasType = CONST.CANVAS; }
if (canvasType === CONST.WEBGL)
{
return null;
}
for (var i = 0; i < pool.length; i++)
{
var container = pool[i];
@ -157,7 +165,6 @@ var CanvasPool = function ()
{
if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent))
{
// console.log('CanvasPool.remove found and removed');
container.parent = null;
container.canvas.width = 1;
container.canvas.height = 1;

View file

@ -21,10 +21,6 @@
* @property {number} a - The alpha color value in the range 0 to 255.
*/
/**
* @namespace Phaser.Display.Color
*/
var Color = require('./Color');
Color.ColorToRGBA = require('./ColorToRGBA');

View file

@ -59,9 +59,23 @@ var DisplayList = new Class({
*/
this.systems = scene.sys;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.DisplayList#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -73,10 +87,7 @@ var DisplayList = new Class({
*/
start: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -171,9 +182,7 @@ var DisplayList = new Class({
{
this.removeAll();
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**

View file

@ -69,9 +69,26 @@ var GameObjectCreator = new Class({
*/
this.updateList;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.GameObjectCreator#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -83,13 +100,7 @@ var GameObjectCreator = new Class({
*/
start: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -102,9 +113,7 @@ var GameObjectCreator = new Class({
*/
shutdown: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**

View file

@ -68,9 +68,26 @@ var GameObjectFactory = new Class({
*/
this.updateList;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.GameObjectFactory#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -82,13 +99,7 @@ var GameObjectFactory = new Class({
*/
start: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -129,9 +140,7 @@ var GameObjectFactory = new Class({
*/
shutdown: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**

View file

@ -75,9 +75,23 @@ var UpdateList = new Class({
*/
this._pendingRemoval = [];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.UpdateList#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -94,7 +108,6 @@ var UpdateList = new Class({
eventEmitter.on('preupdate', this.preUpdate, this);
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**

View file

@ -6,32 +6,15 @@
var GetValue = require('../../utils/object/GetValue');
// * @param {number} characterWidth - The width of each character in the font set.
// * @param {number} characterHeight - The height of each character in the font set.
// * @param {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.
// * @param {number} [charsPerRow] - The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth.
// * @param {number} [xSpacing=0] - If the characters in the font set have horizontal spacing between them set the required amount here.
// * @param {number} [ySpacing=0] - If the characters in the font set have vertical spacing between them set the required amount here.
// * @param {number} [xOffset=0] - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.
// * @param {number} [yOffset=0] - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.
// Phaser.GameObject.RetroFont = function (game, key, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset)
// {
// image: key,
// width: 32,
// height: 32,
// chars: 'string',
// charsPerRow: null,
// spacing: { x: 0, y: 0 },
// offset: { x: 0, y: 0 }
// }
/**
* [description]
* Parses a Retro Font configuration object so you can pass it to the BitmapText constructor
* and create a BitmapText object using a fixed-width retro font.
*
* @function ParseRetroFont
* @function Phaser.GameObjects.RetroFont.Parse
* @since 3.0.0
* @private
*
* @param {Phaser.Scene} scene - A reference to the Phaser Scene.
* @param {Phaser.GameObjects.RetroFont.Config} config - The font configuration object.
*/
var ParseRetroFont = function (scene, config)
{
@ -39,7 +22,12 @@ var ParseRetroFont = function (scene, config)
var h = config.height;
var cx = Math.floor(w / 2);
var cy = Math.floor(h / 2);
var letters = config.chars;
var letters = GetValue(config, 'chars', '');
if (letters === '')
{
return;
}
var key = GetValue(config, 'image', '');
var offsetX = GetValue(config, 'offset.x', 0);
@ -116,81 +104,4 @@ var ParseRetroFont = function (scene, config)
return entry;
};
/**
* Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET1 = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
/**
* Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET2 = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ';
/**
* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET3 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ';
/**
* Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET4 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789';
/**
* Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET5 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() \'!?-*:0123456789';
/**
* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.'
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET6 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.\' ';
/**
* Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET7 = 'AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-\'39';
/**
* Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET8 = '0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ';
/**
* Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?!
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET9 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,\'"?!';
/**
* Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET10 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
/**
* Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789
* @constant
* @type {string}
*/
ParseRetroFont.TEXT_SET11 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()\':;0123456789';
module.exports = ParseRetroFont;

View file

@ -0,0 +1,34 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var RETRO_FONT_CONST = require('./const');
var Extend = require('../../utils/object/Extend');
/**
* @typedef {object} Phaser.GameObjects.RetroFont.Config
*
* @property {string} image - [description]
* @property {number} offset.x - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.
* @property {number} offset.y - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.
* @property {number} width - The width of each character in the font set.
* @property {number} height - The height of each character in the font set.
* @property {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.
* @property {number} charsPerRow - The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth.
* @property {number} spacing.x - If the characters in the font set have horizontal spacing between them set the required amount here.
* @property {number} spacing.y - If the characters in the font set have vertical spacing between them set the required amount here.
*/
/**
* @namespace Phaser.GameObjects.RetroFont
* @since 3.6.0
*/
var RetroFont = { Parse: require('./ParseRetroFont') };
// Merge in the consts
RetroFont = Extend(false, RetroFont, RETRO_FONT_CONST);
module.exports = RetroFont;

View file

@ -0,0 +1,110 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var RETRO_FONT_CONST = {
/**
* Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET1
* @type {string}
* @since 3.6.0
*/
TEXT_SET1: ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~',
/**
* Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET2
* @type {string}
* @since 3.6.0
*/
TEXT_SET2: ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ',
/**
* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET3
* @type {string}
* @since 3.6.0
*/
TEXT_SET3: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ',
/**
* Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET4
* @type {string}
* @since 3.6.0
*/
TEXT_SET4: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789',
/**
* Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET5
* @type {string}
* @since 3.6.0
*/
TEXT_SET5: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() \'!?-*:0123456789',
/**
* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.'
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET6
* @type {string}
* @since 3.6.0
*/
TEXT_SET6: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.\' ',
/**
* Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET7
* @type {string}
* @since 3.6.0
*/
TEXT_SET7: 'AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-\'39',
/**
* Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET8
* @type {string}
* @since 3.6.0
*/
TEXT_SET8: '0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ',
/**
* Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?!
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET9
* @type {string}
* @since 3.6.0
*/
TEXT_SET9: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,\'"?!',
/**
* Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET10
* @type {string}
* @since 3.6.0
*/
TEXT_SET10: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
/**
* Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789
*
* @name Phaser.GameObjects.RetroFont.TEXT_SET11
* @since 3.6.0
* @type {string}
*/
TEXT_SET11: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()\':;0123456789'
};
module.exports = RETRO_FONT_CONST;

View file

@ -10,18 +10,22 @@ var GameObject = require('../../GameObject');
var GetBitmapTextSize = require('../GetBitmapTextSize');
var Render = require('./DynamicBitmapTextRender');
/**
* @typedef {object} DisplayCallbackConfig
* @property {{topLeft:number,topRight:number,bottomLeft:number,bottomRight:number}} tint - [description]
* @property {number} index - [description]
* @property {number} charCode - [description]
* @property {number} x - [description]
* @property {number} y - [description]
* @property {number} scale - [description]
* @property {number} rotation - [description]
* @property {any} data - [description]
*/
/**
* @callback DisplayCallback
*
* @param {object} display - [description]
* @param {{topLeft:number,topRight:number,bottomLeft:number,bottomRight:number}} display.tint - [description]
* @param {number} display.index - [description]
* @param {number} display.charCode - [description]
* @param {number} display.x - [description]
* @param {number} display.y - [description]
* @param {number} display.scale - [description]
* @param {number} display.rotation - [description]
* @param {[type]} display.data - [description]
* @param {DisplayCallbackConfig} display - [description]
*/
/**
@ -37,6 +41,7 @@ var Render = require('./DynamicBitmapTextRender');
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.Origin
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.ScrollFactor
@ -60,6 +65,7 @@ var DynamicBitmapText = new Class({
Components.Alpha,
Components.BlendMode,
Components.Depth,
Components.Mask,
Components.Origin,
Components.Pipeline,
Components.ScrollFactor,
@ -370,7 +376,7 @@ var DynamicBitmapText = new Class({
* @method Phaser.GameObjects.DynamicBitmapText#toJSON
* @since 3.0.0
*
* @return {JSONGameObject.<JSONBitmapText>} [description]
* @return {JSONBitmapText} [description]
*/
toJSON: function ()
{

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../../utils/NOOP');
var renderCanvas = require('../../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./DynamicBitmapTextWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./DynamicBitmapTextCanvasRenderer');
}

View file

@ -9,7 +9,6 @@ var Components = require('../../components');
var GameObject = require('../../GameObject');
var GetBitmapTextSize = require('../GetBitmapTextSize');
var ParseFromAtlas = require('../ParseFromAtlas');
var ParseRetroFont = require('../ParseRetroFont');
var Render = require('./BitmapTextRender');
/**
@ -29,6 +28,7 @@ var Render = require('./BitmapTextRender');
/**
* @typedef {object} JSONBitmapText
* @extends {JSONGameObject}
*
* @property {string} font - [description]
* @property {string} text - [description]
@ -49,6 +49,7 @@ var Render = require('./BitmapTextRender');
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.Origin
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.ScaleMode
@ -73,6 +74,7 @@ var BitmapText = new Class({
Components.Alpha,
Components.BlendMode,
Components.Depth,
Components.Mask,
Components.Origin,
Components.Pipeline,
Components.ScaleMode,
@ -288,7 +290,7 @@ var BitmapText = new Class({
* @method Phaser.GameObjects.BitmapText#toJSON
* @since 3.0.0
*
* @return {JSONGameObject.<JSONBitmapText>} [description]
* @return {JSONBitmapText} [description]
*/
toJSON: function ()
{
@ -310,7 +312,6 @@ var BitmapText = new Class({
});
BitmapText.ParseRetroFont = ParseRetroFont;
BitmapText.ParseFromAtlas = ParseFromAtlas;
module.exports = BitmapText;

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../../utils/NOOP');
var renderCanvas = require('../../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./BitmapTextWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./BitmapTextCanvasRenderer');
}

View file

@ -13,7 +13,7 @@ var GameObject = require('../GameObject');
var List = require('../../structs/List');
/**
* @callback BlitterFromCallback
* @callback Phaser.GameObjects.Blitter.BlitterFromCallback
*
* @param {Phaser.GameObjects.Blitter} blitter - [description]
* @param {integer} index - [description]
@ -44,6 +44,7 @@ var List = require('../../structs/List');
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.ScaleMode
* @extends Phaser.GameObjects.Components.ScrollFactor
@ -66,6 +67,7 @@ var Blitter = new Class({
Components.Alpha,
Components.BlendMode,
Components.Depth,
Components.Mask,
Components.Pipeline,
Components.ScaleMode,
Components.ScrollFactor,
@ -151,7 +153,7 @@ var Blitter = new Class({
* @method Phaser.GameObjects.Blitter#createFromCallback
* @since 3.0.0
*
* @param {BlitterFromCallback} callback - The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob.
* @param {Phaser.GameObjects.Blitter.BlitterFromCallback} callback - The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob.
* @param {integer} quantity - The quantity of Bob objects to create.
* @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture.
* @param {boolean} [visible=true] - [description]

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../utils/NOOP');
var renderCanvas = require('../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./BlitterWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./BlitterCanvasRenderer');
}

View file

@ -308,7 +308,7 @@ var Animation = new Class({
/**
* Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback.
*
* @method Phaser.GameObjects.Components.Animation#delay
* @method Phaser.GameObjects.Components.Animation#setDelay
* @since 3.4.0
*
* @param {integer} [value=0] - The amount of time, in milliseconds, to wait before starting playback.
@ -327,7 +327,7 @@ var Animation = new Class({
/**
* Gets the amount of time, in milliseconds that the animation will be delayed before starting playback.
*
* @method Phaser.GameObjects.Components.Animation#delay
* @method Phaser.GameObjects.Components.Animation#getDelay
* @since 3.4.0
*
* @return {integer} The amount of time, in milliseconds, the Animation will wait before starting playback.

View file

@ -0,0 +1,128 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var BitmapMask = require('../../display/mask/BitmapMask');
var GeometryMask = require('../../display/mask/GeometryMask');
/**
* Provides methods used for getting and setting the mask of a Game Object.
*
* @name Phaser.GameObjects.Components.Mask
* @since 3.0.0
*/
var Mask = {
/**
* The Mask this Game Object is using during render.
*
* @name Phaser.GameObjects.Components.Mask#mask
* @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask}
* @since 3.0.0
*/
mask: null,
/**
* Sets the mask that this Game Object will use to render with.
*
* The mask must have been previously created and can be either a
* GeometryMask or a BitmapMask.
*
* Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas.
*
* If a mask is already set on this Game Object it will be immediately replaced.
*
* @method Phaser.GameObjects.Components.Mask#setMask
* @since 3.6.2
*
* @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering.
*
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
*/
setMask: function (mask)
{
this.mask = mask;
return this;
},
/**
* Clears the mask that this Game Object was using.
*
* @method Phaser.GameObjects.Components.Mask#clearMask
* @since 3.6.2
*
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
*/
clearMask: function ()
{
this.mask = null;
return this;
},
/**
* Creates and returns a Bitmap Mask. This mask can be used by any Game Object,
* including this one.
*
* To create the mask you need to pass in a reference to a renderable Game Object.
* A renderable Game Object is one that uses a texture to render with, such as an
* Image, Sprite, Render Texture or BitmapText.
*
* If you do not provide a renderable object, and this Game Object has a texture,
* it will use itself as the object. This means you can call this method to create
* a Bitmap Mask from any renderable Game Object.
*
* @method Phaser.GameObjects.Components.Mask#createBitmapMask
* @since 3.6.2
*
* @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite.
*
* @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created.
*/
createBitmapMask: function (renderable)
{
if (renderable === undefined && this.texture)
{
// eslint-disable-next-line consistent-this
renderable = this;
}
return new BitmapMask(this.scene, renderable);
},
/**
* Creates and returns a Geometry Mask. This mask can be used by any Game Object,
* including this one.
*
* To create the mask you need to pass in a reference to a Graphics Game Object.
*
* If you do not provide a graphics object, and this Game Object is an instance
* of a Graphics object, then it will use itself to create the mask.
*
* This means you can call this method to create a Geometry Mask from any Graphics Game Object.
*
* @method Phaser.GameObjects.Components.Mask#createGeometryMask
* @since 3.6.2
*
* @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask.
*
* @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created.
*/
createGeometryMask: function (graphics)
{
if (graphics === undefined && this.type === 'Graphics')
{
// eslint-disable-next-line consistent-this
graphics = this;
}
return new GeometryMask(this.scene, graphics);
}
};
module.exports = Mask;

View file

@ -17,6 +17,7 @@ module.exports = {
Depth: require('./Depth'),
Flip: require('./Flip'),
GetBounds: require('./GetBounds'),
Mask: require('./Mask'),
MatrixStack: require('./MatrixStack'),
Origin: require('./Origin'),
Pipeline: require('./Pipeline'),

View file

@ -18,11 +18,6 @@ var Vector2 = require('../../math/Vector2');
* @classdesc
* A Container Game Object.
*
* WARNING: EXPERIMENTAL. There are several known cases where Containers will not behave correctly,
* especially if you use a multi-camera or transformed camera set-up. We are still working on them,
* but wanted to release as part of 3.4 under a beta feature flag, because in the main they work
* are and worth getting used to.
*
* A Container, as the name implies, can 'contain' other types of Game Object.
* When a Game Object is added to a Container, the Container becomes responsible for the rendering of it.
* By default it will be removed from the Display List and instead added to the Containers own internal list.
@ -44,8 +39,10 @@ var Vector2 = require('../../math/Vector2');
* to use as their hit area. Container children can also be enabled for input, independent of the Container.
*
* Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However,
* if Container children are enabled for physics you may get unexpected results,such as offset bodies,
* if the Container itself, or any of its ancestors, is positioned anywhere other than at 0x0.
* if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies,
* if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children
* with physics do not factor in the Container due to the excessive extra calculations needed. Please structure
* your game to work around this.
*
* It's important to understand the impact of using Containers. They add additional processing overhead into
* every one of their children. The deeper you nest them, the more the cost escalates. This is especially true

View file

@ -8,8 +8,6 @@
var Container = require('./Container');
var GameObjectFactory = require('../GameObjectFactory');
var hasWarned = false;
/**
* Creates a new Container Game Object and adds it to the Scene.
*
@ -26,11 +24,5 @@ var hasWarned = false;
*/
GameObjectFactory.register('container', function (x, y, children)
{
if (!hasWarned)
{
console.warn('Use of a beta feature: Containers');
hasWarned = true;
}
return this.displayList.add(new Container(this.scene, x, y, children));
});

View file

@ -8,12 +8,12 @@
var renderWebGL = require('../../utils/NOOP');
var renderCanvas = require('../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./ContainerWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./ContainerCanvasRenderer');
}

View file

@ -27,6 +27,7 @@ var Render = require('./GraphicsRender');
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.Transform
* @extends Phaser.GameObjects.Components.Visible
@ -43,6 +44,7 @@ var Graphics = new Class({
Components.Alpha,
Components.BlendMode,
Components.Depth,
Components.Mask,
Components.Pipeline,
Components.Transform,
Components.Visible,

View file

@ -7,7 +7,7 @@
var renderWebGL = require('../../utils/NOOP');
var renderCanvas = require('../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./GraphicsWebGLRenderer');
@ -15,7 +15,7 @@ if (WEBGL_RENDERER)
renderCanvas = require('./GraphicsCanvasRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./GraphicsCanvasRenderer');
}

View file

@ -561,7 +561,7 @@ var Group = new Class({
},
/**
* Removes a member of this group.
* Removes a member of this Group and optionally removes it from the Scene and / or destroys it.
*
* Calls {@link Phaser.GameObjects.Group#removeCallback}.
*
@ -569,13 +569,15 @@ var Group = new Class({
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} child - The Game Object to remove.
* @param {boolean} [removeFromScene=false] - Also remove the group member from the scene.
* @param {boolean} [removeFromScene=false] - Optionally remove the Group member from the Scene it belongs to.
* @param {boolean} [destroyChild=false] - Optionally call destroy on the removed Group member.
*
* @return {Phaser.GameObjects.Group} This Group object.
*/
remove: function (child, removeFromScene)
remove: function (child, removeFromScene, destroyChild)
{
if (removeFromScene === undefined) { removeFromScene = false; }
if (destroyChild === undefined) { destroyChild = false; }
if (!this.children.contains(child))
{
@ -589,36 +591,42 @@ var Group = new Class({
this.removeCallback.call(this, child);
}
if (removeFromScene)
child.off('destroy', this.remove, this);
if (destroyChild)
{
this.scene.sys.displayList.remove(child);
child.destroy();
}
else if (removeFromScene)
{
child.scene.sys.displayList.remove(child);
if (child.preUpdate)
{
this.scene.sys.updateList.remove(child);
child.scene.sys.updateList.remove(child);
}
}
child.off('destroy', this.remove, this);
return this;
},
/**
* Removes all members of this group.
* Removes all members of this Group and optionally removes them from the Scene and / or destroys them.
*
* Does not call {@link Phaser.GameObjects.Group#removeCallback}.
*
* @method Phaser.GameObjects.Group#clear
* @since 3.0.0
*
* @param {boolean} [removeFromScene=false] - Also remove each group member from the scene.
* @param {boolean} [removeFromScene=false] - Optionally remove each Group member from the Scene.
* @param {boolean} [destroyChild=false] - Optionally call destroy on the removed Group members.
*
* @return {Phaser.GameObjects.Group} This group.
*/
clear: function (removeFromScene)
clear: function (removeFromScene, destroyChild)
{
if (removeFromScene === undefined) { removeFromScene = false; }
if (destroyChild === undefined) { destroyChild = false; }
var children = this.children;
@ -628,13 +636,17 @@ var Group = new Class({
gameObject.off('destroy', this.remove, this);
if (removeFromScene)
if (destroyChild)
{
this.scene.sys.displayList.remove(gameObject);
gameObject.destroy();
}
else if (removeFromScene)
{
gameObject.scene.sys.displayList.remove(gameObject);
if (gameObject.preUpdate)
{
this.scene.sys.updateList.remove(gameObject);
gameObject.scene.sys.updateList.remove(gameObject);
}
}
}
@ -686,7 +698,7 @@ var Group = new Class({
},
/**
* Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,
* Scans the Group, from top to bottom, for the first member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,
* assigns `x` and `y`, and returns the member.
*
* If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.
@ -706,33 +718,178 @@ var Group = new Class({
* @return {?Phaser.GameObjects.GameObject} The first matching group member, or a newly created member, or null.
*/
getFirst: function (state, createIfNull, x, y, key, frame, visible)
{
return this.getHandler(true, 1, state, createIfNull, x, y, key, frame, visible);
},
/**
* Scans the Group, from top to bottom, for the nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,
* assigns `x` and `y`, and returns the member.
*
* If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.
* Unless a new member is created, `key`, `frame`, and `visible` are ignored.
*
* @method Phaser.GameObjects.Group#getFirstNth
* @since 3.6.0
*
* @param {integer} nth - The nth matching Group member to search for.
* @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match.
* @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.
* @param {number} [x] - The horizontal position of the Game Object in the world.
* @param {number} [y] - The vertical position of the Game Object in the world.
* @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).
* @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).
* @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).
*
* @return {?Phaser.GameObjects.GameObject} The first matching group member, or a newly created member, or null.
*/
getFirstNth: function (nth, state, createIfNull, x, y, key, frame, visible)
{
return this.getHandler(true, nth, state, createIfNull, x, y, key, frame, visible);
},
/**
* Scans the Group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,
* assigns `x` and `y`, and returns the member.
*
* If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.
* Unless a new member is created, `key`, `frame`, and `visible` are ignored.
*
* @method Phaser.GameObjects.Group#getLast
* @since 3.6.0
*
* @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match.
* @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.
* @param {number} [x] - The horizontal position of the Game Object in the world.
* @param {number} [y] - The vertical position of the Game Object in the world.
* @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).
* @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).
* @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).
*
* @return {?Phaser.GameObjects.GameObject} The first matching group member, or a newly created member, or null.
*/
getLast: function (state, createIfNull, x, y, key, frame, visible)
{
return this.getHandler(false, 1, state, createIfNull, x, y, key, frame, visible);
},
/**
* Scans the Group for the last nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,
* assigns `x` and `y`, and returns the member.
*
* If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.
* Unless a new member is created, `key`, `frame`, and `visible` are ignored.
*
* @method Phaser.GameObjects.Group#getLastNth
* @since 3.6.0
*
* @param {integer} nth - The nth matching Group member to search for.
* @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match.
* @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.
* @param {number} [x] - The horizontal position of the Game Object in the world.
* @param {number} [y] - The vertical position of the Game Object in the world.
* @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).
* @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).
* @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).
*
* @return {?Phaser.GameObjects.GameObject} The first matching group member, or a newly created member, or null.
*/
getLastNth: function (nth, state, createIfNull, x, y, key, frame, visible)
{
return this.getHandler(false, nth, state, createIfNull, x, y, key, frame, visible);
},
/**
* Scans the group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,
* assigns `x` and `y`, and returns the member.
*
* If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.
* Unless a new member is created, `key`, `frame`, and `visible` are ignored.
*
* @method Phaser.GameObjects.Group#getHandler
* @private
* @since 3.6.0
*
* @param {boolean} forwards - Search front to back or back to front?
* @param {integer} nth - Stop matching after nth successful matches.
* @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match.
* @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.
* @param {number} [x] - The horizontal position of the Game Object in the world.
* @param {number} [y] - The vertical position of the Game Object in the world.
* @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).
* @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).
* @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).
*
* @return {?Phaser.GameObjects.GameObject} The first matching group member, or a newly created member, or null.
*/
getHandler: function (forwards, nth, state, createIfNull, x, y, key, frame, visible)
{
if (state === undefined) { state = false; }
if (createIfNull === undefined) { createIfNull = false; }
var gameObject;
var i;
var total = 0;
var children = this.children.entries;
for (var i = 0; i < children.length; i++)
if (forwards)
{
gameObject = children[i];
if (gameObject.active === state)
for (i = 0; i < children.length; i++)
{
if (typeof(x) === 'number')
{
gameObject.x = x;
}
gameObject = children[i];
if (typeof(y) === 'number')
if (gameObject.active === state)
{
gameObject.y = y;
}
total++;
return gameObject;
if (total === nth)
{
break;
}
}
else
{
gameObject = null;
}
}
}
else
{
for (i = children.length - 1; i >= 0; i--)
{
gameObject = children[i];
if (gameObject.active === state)
{
total++;
if (total === nth)
{
break;
}
}
else
{
gameObject = null;
}
}
}
if (gameObject)
{
if (typeof(x) === 'number')
{
gameObject.x = x;
}
if (typeof(y) === 'number')
{
gameObject.y = y;
}
return gameObject;
}
// Got this far? We need to create or bail
if (createIfNull)

View file

@ -29,6 +29,7 @@ var ImageRender = require('./ImageRender');
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.Origin
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.ScaleMode
@ -55,6 +56,7 @@ var Image = new Class({
Components.Depth,
Components.Flip,
Components.GetBounds,
Components.Mask,
Components.Origin,
Components.Pipeline,
Components.ScaleMode,

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../utils/NOOP');
var renderCanvas = require('../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./ImageWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./ImageCanvasRenderer');
}

View file

@ -30,6 +30,7 @@ var GameObjects = {
Particles: require('./particles'),
PathFollower: require('./pathfollower/PathFollower'),
RenderTexture: require('./rendertexture/RenderTexture'),
RetroFont: require('./bitmaptext/RetroFont'),
Sprite3D: require('./sprite3d/Sprite3D'),
Sprite: require('./sprite/Sprite'),
Text: require('./text/static/Text'),
@ -75,7 +76,7 @@ var GameObjects = {
};
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
// WebGL only Game Objects
GameObjects.Mesh = require('./mesh/Mesh');

View file

@ -25,6 +25,7 @@ var MeshRender = require('./MeshRender');
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.Origin
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.ScaleMode
@ -54,6 +55,7 @@ var Mesh = new Class({
Components.Depth,
Components.Flip,
Components.GetBounds,
Components.Mask,
Components.Origin,
Components.Pipeline,
Components.ScaleMode,

View file

@ -27,7 +27,7 @@ var GameObjectFactory = require('../GameObjectFactory');
*
* @return {Phaser.GameObjects.Mesh} The Game Object that was created.
*/
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
GameObjectFactory.register('mesh', function (x, y, vertices, uv, colors, alphas, texture, frame)
{

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../utils/NOOP');
var renderCanvas = require('../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./MeshWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./MeshCanvasRenderer');
}

View file

@ -196,26 +196,6 @@ var Particle = new Class({
*/
this.rotation = 0;
/**
* The horizontal scroll factor of this Particle.
*
* @name Phaser.GameObjects.Particles.Particle#scrollFactorX
* @type {number}
* @default 1
* @since 3.0.0
*/
this.scrollFactorX = 1;
/**
* The vertical scroll factor of this Particle.
*
* @name Phaser.GameObjects.Particles.Particle#scrollFactorY
* @type {number}
* @default 1
* @since 3.0.0
*/
this.scrollFactorY = 1;
/**
* The tint applied to this Particle.
*

View file

@ -44,6 +44,7 @@ var Wrap = require('../../math/Wrap');
* @since 3.0.0
*
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.ScrollFactor
* @extends Phaser.GameObjects.Components.Visible
*
@ -54,6 +55,7 @@ var ParticleEmitter = new Class({
Mixins: [
Components.BlendMode,
Components.Mask,
Components.ScrollFactor,
Components.Visible
],

View file

@ -17,7 +17,7 @@ var Render = require('./ParticleManagerRender');
* [description]
*
* @class ParticleEmitterManager
* @extends Phaser.GameObjects.Particles.GameObject
* @extends Phaser.GameObjects.GameObject
* @memberOf Phaser.GameObjects.Particles
* @constructor
* @since 3.0.0

View file

@ -85,8 +85,8 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol
var x = -ox;
var y = -oy;
var tx = particle.x - cameraScrollX * particle.scrollFactorX;
var ty = particle.y - cameraScrollY * particle.scrollFactorY;
var tx = particle.x - cameraScrollX;
var ty = particle.y - cameraScrollY;
if (roundPixels)
{

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../utils/NOOP');
var renderCanvas = require('../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./ParticleManagerWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./ParticleManagerCanvasRenderer');
}

View file

@ -14,11 +14,6 @@ module.exports = {
Particle: require('./Particle'),
ParticleEmitter: require('./ParticleEmitter'),
ParticleEmitterManager: require('./ParticleEmitterManager'),
Zones: {
DeathZone: require('./zones/DeathZone'),
EdgeZone: require('./zones/EdgeZone'),
RandomZone: require('./zones/RandomZone')
}
Zones: require('./zones')
};

View file

@ -0,0 +1,17 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @namespace Phaser.GameObjects.Particles.Zones
*/
module.exports = {
DeathZone: require('./DeathZone'),
EdgeZone: require('./EdgeZone'),
RandomZone: require('./RandomZone')
};

View file

@ -23,7 +23,7 @@ var GameObjectFactory = require('../GameObjectFactory');
*
* @return {Phaser.GameObjects.Quad} The Game Object that was created.
*/
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
GameObjectFactory.register('quad', function (x, y, key, frame)
{

View file

@ -29,6 +29,7 @@ var RenderTextureWebGL = require('./RenderTextureWebGL');
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.MatrixStack
* @extends Phaser.GameObjects.Components.Origin
* @extends Phaser.GameObjects.Components.Pipeline
@ -55,6 +56,7 @@ var RenderTexture = new Class({
Components.Depth,
Components.Flip,
Components.GetBounds,
Components.Mask,
Components.MatrixStack,
Components.Origin,
Components.Pipeline,

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../utils/NOOP');
var renderCanvas = require('../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./RenderTextureWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./RenderTextureCanvasRenderer');
}

View file

@ -32,6 +32,7 @@ var SpriteRender = require('./SpriteRender');
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.Origin
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.ScaleMode
@ -58,6 +59,7 @@ var Sprite = new Class({
Components.Depth,
Components.Flip,
Components.GetBounds,
Components.Mask,
Components.Origin,
Components.Pipeline,
Components.ScaleMode,
@ -96,6 +98,7 @@ var Sprite = new Class({
* [description]
*
* @method Phaser.GameObjects.Sprite#preUpdate
* @protected
* @since 3.0.0
*
* @param {number} time - [description]

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../utils/NOOP');
var renderCanvas = require('../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./SpriteWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./SpriteCanvasRenderer');
}

View file

@ -71,7 +71,7 @@ var TextStyle = new Class({
/**
* The Text object that this TextStyle is styling.
*
* @name Phaser.GameObjects.Components.TextStyle#parent
* @name Phaser.GameObjects.Text.TextStyle#parent
* @type {Phaser.GameObjects.Text}
* @since 3.0.0
*/
@ -80,7 +80,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#fontFamily
* @name Phaser.GameObjects.Text.TextStyle#fontFamily
* @type {string}
* @default 'Courier'
* @since 3.0.0
@ -90,7 +90,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#fontSize
* @name Phaser.GameObjects.Text.TextStyle#fontSize
* @type {string}
* @default '16px'
* @since 3.0.0
@ -100,7 +100,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#fontStyle
* @name Phaser.GameObjects.Text.TextStyle#fontStyle
* @type {string}
* @since 3.0.0
*/
@ -109,7 +109,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#backgroundColor
* @name Phaser.GameObjects.Text.TextStyle#backgroundColor
* @type {string}
* @since 3.0.0
*/
@ -118,7 +118,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#color
* @name Phaser.GameObjects.Text.TextStyle#color
* @type {string}
* @default '#fff'
* @since 3.0.0
@ -128,7 +128,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#stroke
* @name Phaser.GameObjects.Text.TextStyle#stroke
* @type {string}
* @default '#fff'
* @since 3.0.0
@ -138,7 +138,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#strokeThickness
* @name Phaser.GameObjects.Text.TextStyle#strokeThickness
* @type {number}
* @default 0
* @since 3.0.0
@ -148,7 +148,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#shadowOffsetX
* @name Phaser.GameObjects.Text.TextStyle#shadowOffsetX
* @type {number}
* @default 0
* @since 3.0.0
@ -158,7 +158,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#shadowOffsetY
* @name Phaser.GameObjects.Text.TextStyle#shadowOffsetY
* @type {number}
* @default 0
* @since 3.0.0
@ -168,7 +168,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#shadowColor
* @name Phaser.GameObjects.Text.TextStyle#shadowColor
* @type {string}
* @default '#000'
* @since 3.0.0
@ -178,7 +178,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#shadowBlur
* @name Phaser.GameObjects.Text.TextStyle#shadowBlur
* @type {number}
* @default 0
* @since 3.0.0
@ -188,7 +188,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#shadowStroke
* @name Phaser.GameObjects.Text.TextStyle#shadowStroke
* @type {boolean}
* @default false
* @since 3.0.0
@ -198,7 +198,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#shadowFill
* @name Phaser.GameObjects.Text.TextStyle#shadowFill
* @type {boolean}
* @default false
* @since 3.0.0
@ -208,7 +208,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#align
* @name Phaser.GameObjects.Text.TextStyle#align
* @type {string}
* @default 'left'
* @since 3.0.0
@ -218,7 +218,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#maxLines
* @name Phaser.GameObjects.Text.TextStyle#maxLines
* @type {integer}
* @default 0
* @since 3.0.0
@ -228,7 +228,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#fixedWidth
* @name Phaser.GameObjects.Text.TextStyle#fixedWidth
* @type {number}
* @default 0
* @since 3.0.0
@ -238,7 +238,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#fixedHeight
* @name Phaser.GameObjects.Text.TextStyle#fixedHeight
* @type {number}
* @default 0
* @since 3.0.0
@ -248,7 +248,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#rtl
* @name Phaser.GameObjects.Text.TextStyle#rtl
* @type {boolean}
* @default false
* @since 3.0.0
@ -258,7 +258,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#testString
* @name Phaser.GameObjects.Text.TextStyle#testString
* @type {string}
* @default '|MÉqgy'
* @since 3.0.0
@ -268,7 +268,7 @@ var TextStyle = new Class({
/**
* The amount of horizontal padding adding to the width of the text when calculating the font metrics.
*
* @name Phaser.GameObjects.Components.TextStyle#baselineX
* @name Phaser.GameObjects.Text.TextStyle#baselineX
* @type {number}
* @default 1.2
* @since 3.3.0
@ -278,7 +278,7 @@ var TextStyle = new Class({
/**
* The amount of vertical padding adding to the width of the text when calculating the font metrics.
*
* @name Phaser.GameObjects.Components.TextStyle#baselineY
* @name Phaser.GameObjects.Text.TextStyle#baselineY
* @type {number}
* @default 1.4
* @since 3.3.0
@ -288,7 +288,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @name Phaser.GameObjects.Components.TextStyle#_font
* @name Phaser.GameObjects.Text.TextStyle#_font
* @type {string}
* @private
* @since 3.0.0
@ -319,7 +319,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setStyle
* @method Phaser.GameObjects.Text.TextStyle#setStyle
* @since 3.0.0
*
* @param {CSSStyleRule} style - [description]
@ -383,7 +383,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#syncFont
* @method Phaser.GameObjects.Text.TextStyle#syncFont
* @since 3.0.0
*
* @param {HTMLCanvasElement} canvas - [description]
@ -397,7 +397,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#syncStyle
* @method Phaser.GameObjects.Text.TextStyle#syncStyle
* @since 3.0.0
*
* @param {HTMLCanvasElement} canvas - [description]
@ -418,7 +418,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#syncShadow
* @method Phaser.GameObjects.Text.TextStyle#syncShadow
* @since 3.0.0
*
* @param {CanvasRenderingContext2D} context - [description]
@ -445,7 +445,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#update
* @method Phaser.GameObjects.Text.TextStyle#update
* @since 3.0.0
*
* @param {boolean} recalculateMetrics - [description]
@ -467,7 +467,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setFont
* @method Phaser.GameObjects.Text.TextStyle#setFont
* @since 3.0.0
*
* @param {(string|object)} font - [description]
@ -495,7 +495,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setFontFamily
* @method Phaser.GameObjects.Text.TextStyle#setFontFamily
* @since 3.0.0
*
* @param {string} family - [description]
@ -512,7 +512,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setFontStyle
* @method Phaser.GameObjects.Text.TextStyle#setFontStyle
* @since 3.0.0
*
* @param {string} style - [description]
@ -529,7 +529,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setFontSize
* @method Phaser.GameObjects.Text.TextStyle#setFontSize
* @since 3.0.0
*
* @param {(number|string)} size - [description]
@ -551,7 +551,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setTestString
* @method Phaser.GameObjects.Text.TextStyle#setTestString
* @since 3.0.0
*
* @param {string} string - [description]
@ -568,7 +568,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setFixedSize
* @method Phaser.GameObjects.Text.TextStyle#setFixedSize
* @since 3.0.0
*
* @param {number} width - [description]
@ -597,7 +597,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setBackgroundColor
* @method Phaser.GameObjects.Text.TextStyle#setBackgroundColor
* @since 3.0.0
*
* @param {string} color - [description]
@ -614,7 +614,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setFill
* @method Phaser.GameObjects.Text.TextStyle#setFill
* @since 3.0.0
*
* @param {string} color - [description]
@ -631,7 +631,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setColor
* @method Phaser.GameObjects.Text.TextStyle#setColor
* @since 3.0.0
*
* @param {string} color - [description]
@ -648,7 +648,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setStroke
* @method Phaser.GameObjects.Text.TextStyle#setStroke
* @since 3.0.0
*
* @param {string} color - [description]
@ -677,7 +677,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setShadow
* @method Phaser.GameObjects.Text.TextStyle#setShadow
* @since 3.0.0
*
* @param {number} [x=0] - [description]
@ -711,7 +711,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setShadowOffset
* @method Phaser.GameObjects.Text.TextStyle#setShadowOffset
* @since 3.0.0
*
* @param {number} [x=0] - [description]
@ -733,7 +733,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setShadowColor
* @method Phaser.GameObjects.Text.TextStyle#setShadowColor
* @since 3.0.0
*
* @param {string} [color='#000'] - [description]
@ -752,7 +752,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setShadowBlur
* @method Phaser.GameObjects.Text.TextStyle#setShadowBlur
* @since 3.0.0
*
* @param {number} [blur=0] - [description]
@ -771,7 +771,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setShadowStroke
* @method Phaser.GameObjects.Text.TextStyle#setShadowStroke
* @since 3.0.0
*
* @param {boolean} enabled - [description]
@ -788,7 +788,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setShadowFill
* @method Phaser.GameObjects.Text.TextStyle#setShadowFill
* @since 3.0.0
*
* @param {boolean} enabled - [description]
@ -805,7 +805,7 @@ var TextStyle = new Class({
/**
* Set the width (in pixels) to use for wrapping lines. Pass in null to remove wrapping by width.
*
* @method Phaser.GameObjects.Components.TextStyle#setWordWrapWidth
* @method Phaser.GameObjects.Text.TextStyle#setWordWrapWidth
* @since 3.0.0
*
* @param {number} width - The maximum width of a line in pixels. Set to null to remove wrapping.
@ -828,7 +828,7 @@ var TextStyle = new Class({
/**
* Set a custom callback for wrapping lines. Pass in null to remove wrapping by callback.
*
* @method Phaser.GameObjects.Components.TextStyle#setWordWrapCallback
* @method Phaser.GameObjects.Text.TextStyle#setWordWrapCallback
* @since 3.0.0
*
* @param {TextStyleWordWrapCallback} callback - A custom function that will be responsible for wrapping the
@ -852,7 +852,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setAlign
* @method Phaser.GameObjects.Text.TextStyle#setAlign
* @since 3.0.0
*
* @param {string} align - [description]
@ -871,7 +871,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#setMaxLines
* @method Phaser.GameObjects.Text.TextStyle#setMaxLines
* @since 3.0.0
*
* @param {integer} [max=0] - [description]
@ -890,7 +890,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#getTextMetrics
* @method Phaser.GameObjects.Text.TextStyle#getTextMetrics
* @since 3.0.0
*
* @return {object} [description]
@ -909,7 +909,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#toJSON
* @method Phaser.GameObjects.Text.TextStyle#toJSON
* @since 3.0.0
*
* @return {object} [description]
@ -931,7 +931,7 @@ var TextStyle = new Class({
/**
* [description]
*
* @method Phaser.GameObjects.Components.TextStyle#destroy
* @method Phaser.GameObjects.Text.TextStyle#destroy
* @since 3.0.0
*/
destroy: function ()

View file

@ -32,6 +32,7 @@ var TextStyle = require('../TextStyle');
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.Origin
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.ScaleMode
@ -57,6 +58,7 @@ var Text = new Class({
Components.Depth,
Components.Flip,
Components.GetBounds,
Components.Mask,
Components.Origin,
Components.Pipeline,
Components.ScaleMode,
@ -102,7 +104,7 @@ var Text = new Class({
* [description]
*
* @name Phaser.GameObjects.Text#style
* @type {Phaser.GameObjects.Components.TextStyle}
* @type {Phaser.GameObjects.Text.TextStyle}
* @since 3.0.0
*/
this.style = new TextStyle(this, style);
@ -1060,7 +1062,7 @@ var Text = new Class({
* @method Phaser.GameObjects.Text#toJSON
* @since 3.0.0
*
* @return {object} [description]
* @return {JSONGameObject} A JSON representation of the Game Object.
*/
toJSON: function ()
{

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../../utils/NOOP');
var renderCanvas = require('../../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./TextWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./TextCanvasRenderer');
}

View file

@ -27,6 +27,7 @@ var TileSpriteRender = require('./TileSpriteRender');
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
* @extends Phaser.GameObjects.Components.Mask
* @extends Phaser.GameObjects.Components.Origin
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.ScaleMode
@ -55,6 +56,7 @@ var TileSprite = new Class({
Components.Depth,
Components.Flip,
Components.GetBounds,
Components.Mask,
Components.Origin,
Components.Pipeline,
Components.ScaleMode,
@ -274,7 +276,7 @@ var TileSprite = new Class({
*/
destroy: function ()
{
if (this.renderer)
if (this.renderer.gl)
{
this.renderer.deleteTexture(this.tileTexture);
}

View file

@ -7,12 +7,12 @@
var renderWebGL = require('../../utils/NOOP');
var renderCanvas = require('../../utils/NOOP');
if (WEBGL_RENDERER)
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./TileSpriteWebGLRenderer');
}
if (CANVAS_RENDERER)
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./TileSpriteCanvasRenderer');
}

View file

@ -19,10 +19,10 @@ var Vector2 = require('../../math/Vector2');
* @constructor
* @since 3.0.0
*
* @param {number} [x1=0] - [description]
* @param {number} [y1=0] - [description]
* @param {number} [x2=0] - [description]
* @param {number} [y2=0] - [description]
* @param {number} [x1=0] - The x coordinate of the lines starting point.
* @param {number} [y1=0] - The y coordinate of the lines starting point.
* @param {number} [x2=0] - The x coordinate of the lines ending point.
* @param {number} [y2=0] - The y coordinate of the lines ending point.
*/
var Line = new Class({
@ -36,7 +36,7 @@ var Line = new Class({
if (y2 === undefined) { y2 = 0; }
/**
* [description]
* The x coordinate of the lines starting point.
*
* @name Phaser.Geom.Line#x1
* @type {number}
@ -45,7 +45,7 @@ var Line = new Class({
this.x1 = x1;
/**
* [description]
* The y coordinate of the lines starting point.
*
* @name Phaser.Geom.Line#y1
* @type {number}
@ -54,7 +54,7 @@ var Line = new Class({
this.y1 = y1;
/**
* [description]
* The x coordinate of the lines ending point.
*
* @name Phaser.Geom.Line#x2
* @type {number}
@ -63,7 +63,7 @@ var Line = new Class({
this.x2 = x2;
/**
* [description]
* The y coordinate of the lines ending point.
*
* @name Phaser.Geom.Line#y2
* @type {number}
@ -83,7 +83,7 @@ var Line = new Class({
* @param {float} position - [description]
* @param {(Phaser.Geom.Point|object)} [output] - [description]
*
* @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse.
* @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point on the line.
*/
getPoint: function (position, output)
{
@ -110,16 +110,16 @@ var Line = new Class({
},
/**
* [description]
* Get a random Point on the Line.
*
* @method Phaser.Geom.Line#getRandomPoint
* @since 3.0.0
*
* @generic {Phaser.Geom.Point} O - [point,$return]
*
* @param {(Phaser.Geom.Point|object)} [point] - [description]
* @param {(Phaser.Geom.Point|object)} [point] - An instance of a Point to be modified.
*
* @return {Phaser.Geom.Point} [description]
* @return {Phaser.Geom.Point} A random Point on the Line.
*/
getRandomPoint: function (point)
{
@ -127,15 +127,15 @@ var Line = new Class({
},
/**
* [description]
* Set new coordinates for the line endpoints.
*
* @method Phaser.Geom.Line#setTo
* @since 3.0.0
*
* @param {number} [x1=0] - [description]
* @param {number} [y1=0] - [description]
* @param {number} [x2=0] - [description]
* @param {number} [y2=0] - [description]
* @param {number} [x1=0] - The x coordinate of the lines starting point.
* @param {number} [y1=0] - The y coordinate of the lines starting point.
* @param {number} [x2=0] - The x coordinate of the lines ending point.
* @param {number} [y2=0] - The y coordinate of the lines ending point.
*
* @return {Phaser.Geom.Line} This Line object.
*/

View file

@ -7,17 +7,17 @@
var Point = require('../point/Point');
/**
* [description]
* Returns a random point on a given Line.
*
* @function Phaser.Geom.Line.Random
* @since 3.0.0
*
* @generic {Phaser.Geom.Point} O - [out,$return]
*
* @param {Phaser.Geom.Line} line - [description]
* @param {(Phaser.Geom.Point|object)} [out] - [description]
* @param {Phaser.Geom.Line} line - The Line to calculate the random Point on.
* @param {(Phaser.Geom.Point|object)} [out] - An instance of a Point to be modified.
*
* @return {(Phaser.Geom.Point|object)} [description]
* @return {(Phaser.Geom.Point|object)} A random Point on the Line.
*/
var Random = function (line, out)
{

View file

@ -8,7 +8,7 @@ var Class = require('../../utils/Class');
/**
* @classdesc
* [description]
* Defines a Point in 2D space, with an x and y component.
*
* @class Point
* @memberOf Phaser.Geom
@ -49,7 +49,7 @@ var Point = new Class({
},
/**
* [description]
* Set the x and y coordinates of the point to the given values.
*
* @method Phaser.Geom.Point#setTo
* @since 3.0.0

View file

@ -62,7 +62,7 @@ var InputPlugin = new Class({
* [description]
*
* @name Phaser.Input.InputPlugin#settings
* @type {SettingsObject}
* @type {Phaser.Scenes.Settings.Object}
* @since 3.5.0
*/
this.settings = scene.sys.settings;
@ -283,9 +283,27 @@ var InputPlugin = new Class({
*/
this._validTypes = [ 'onDown', 'onUp', 'onOver', 'onOut', 'onMove', 'onDragStart', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragLeave', 'onDragOver', 'onDrop' ];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Input.InputPlugin#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.cameras = this.systems.cameras;
this.displayList = this.systems.displayList;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -306,13 +324,8 @@ var InputPlugin = new Class({
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.enabled = true;
this.cameras = this.systems.cameras;
this.displayList = this.systems.displayList;
},
/**

View file

@ -185,6 +185,33 @@ var Key = new Class({
* @since 3.0.0
*/
this._justUp = false;
},
/**
* Resets this Key object back to its default un-pressed state.
*
* @method Phaser.Input.Keyboard.Key.reset
* @since 3.6.0
*
* @return {Phaser.Input.Keyboard.Key} This Key instance.
*/
reset: function ()
{
this.preventDefault = true;
this.enabled = true;
this.isDown = false;
this.isUp = true;
this.altKey = false;
this.ctrlKey = false;
this.shiftKey = false;
this.timeDown = 0;
this.duration = 0;
this.timeUp = 0;
this.repeats = 0;
this._justDown = false;
this._justUp = false;
return this;
}
});

View file

@ -7,7 +7,7 @@
/**
* Used internally by the KeyboardManager.
*
* @function Phaser.Input.Keyboard.Keys.ProcessKeyDown
* @function Phaser.Input.Keyboard.ProcessKeyDown
* @since 3.0.0
*
* @param {Phaser.Input.Keyboard.Key} key - [description]

View file

@ -7,7 +7,7 @@
/**
* Used internally by the KeyboardManager.
*
* @function Phaser.Input.Keyboard.Keys.ProcessKeyUp
* @function Phaser.Input.Keyboard.ProcessKeyUp
* @since 3.0.0
*
* @param {Phaser.Input.Keyboard.Key} key - [description]

View file

@ -1,46 +0,0 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Resets a Key object back to its default settings.
* Optionally resets the keyCode as well.
*
* @function Phaser.Input.Keyboard.Keys.ResetKey
* @since 3.0.0
*
* @param {Phaser.Input.Keyboard.Key} key - [description]
* @param {boolean} [clearKeyCode=false] - [description]
*
* @return {Phaser.Input.Keyboard.Key} [description]
*/
var ResetKey = function (key, clearKeyCode)
{
if (clearKeyCode === undefined) { clearKeyCode = false; }
key.preventDefault = false;
key.enabled = true;
key.isDown = false;
key.isUp = true;
key.altKey = false;
key.ctrlKey = false;
key.shiftKey = false;
key.timeDown = 0;
key.duration = 0;
key.timeUp = 0;
key.repeats = 0;
key._justDown = false;
key._justUp = false;
if (clearKeyCode)
{
key.keyCode = 0;
key.char = '';
}
return key;
};
module.exports = ResetKey;

View file

@ -417,7 +417,7 @@ var File = new Class({
*
* @method Phaser.Loader.File.createObjectURL
* @static
* @param {Image} image - Image object which 'src' attribute should be set to object URL.
* @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.
* @param {Blob} blob - A Blob object to create an object URL for.
* @param {string} defaultType - Default mime type used if blob type is not available.
*/
@ -449,7 +449,7 @@ File.createObjectURL = function (image, blob, defaultType)
*
* @method Phaser.Loader.File.revokeObjectURL
* @static
* @param {Image} image - Image object which 'src' attribute should be revoked.
* @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.
*/
File.revokeObjectURL = function (image)
{

View file

@ -241,7 +241,21 @@ var LoaderPlugin = new Class({
*/
this.state = CONST.LOADER_IDLE;
scene.sys.events.on('start', this.boot, this);
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.pluginStart, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Loader.LoaderPlugin#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
@ -249,16 +263,13 @@ var LoaderPlugin = new Class({
* It is responsible for creating local systems, properties and listening for Scene events.
* Do not invoke it directly.
*
* @method Phaser.Loader.LoaderPlugin#boot
* @method Phaser.Loader.LoaderPlugin#pluginStart
* @private
* @since 3.0.0
* @since 3.5.1
*/
boot: function ()
pluginStart: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -989,9 +1000,7 @@ var LoaderPlugin = new Class({
this.state = CONST.LOADER_SHUTDOWN;
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -1008,7 +1017,7 @@ var LoaderPlugin = new Class({
this.state = CONST.LOADER_DESTROYED;
this.scene.sys.events.off('start', this.start, this);
this.systems.events.off('start', this.pluginStart, this);
this.list = null;
this.inflight = null;

View file

@ -16,9 +16,9 @@ var JSONFile = require('./JSONFile.js');
* @param {string} key - The key of the file within the loader.
* @param {string} url - The url to load the file from.
* @param {string} path - The path of the file.
* @param {XHRSettingsObject} xhrSettings - Optional file specific XHR settings.
* @param {XHRSettingsObject} [xhrSettings] - Optional file specific XHR settings.
*
* @return {Phaser.Loader.FileTypes.AnimationJSONFile} A File instance to be added to the Loader.
* @return {Phaser.Loader.FileTypes.JSONFile} A File instance to be added to the Loader.
*/
var AnimationJSONFile = function (key, url, path, xhrSettings)
{

View file

@ -18,8 +18,8 @@ var JSONFile = require('./JSONFile.js');
* @param {string} textureURL - The url to load the texture file from.
* @param {string} atlasURL - The url to load the atlas file from.
* @param {string} path - The path of the file.
* @param {XHRSettingsObject} textureXhrSettings - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} atlasXhrSettings - Optional atlas file specific XHR settings.
* @param {XHRSettingsObject} [textureXhrSettings] - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} [atlasXhrSettings] - Optional atlas file specific XHR settings.
*
* @return {object} An object containing two File objects to be added to the loader.
*/
@ -53,8 +53,8 @@ var AtlasJSONFile = function (key, textureURL, atlasURL, path, textureXhrSetting
* @param {string} key - The key of the file within the loader.
* @param {string} textureURL - The url to load the texture file from.
* @param {string} atlasURL - The url to load the atlas file from.
* @param {XHRSettingsObject} textureXhrSettings - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} atlasXhrSettings - Optional atlas file specific XHR settings.
* @param {XHRSettingsObject} [textureXhrSettings] - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} [atlasXhrSettings] - Optional atlas file specific XHR settings.
*
* @return {Phaser.Loader.LoaderPlugin} The Loader.
*/

View file

@ -24,8 +24,8 @@ var HTML5AudioFile = require('./HTML5AudioFile');
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {AudioContext} audioContext - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
* @param {AudioContext} [audioContext] - [description]
*/
var AudioFile = new Class({
@ -38,7 +38,8 @@ var AudioFile = new Class({
/**
* [description]
*
* @property {AudioContext} context
* @name Phaser.Loader.FileTypes.AudioFile#context
* @type {AudioContext}
* @since 3.0.0
*/
this.context = audioContext;
@ -140,7 +141,7 @@ AudioFile.create = function (loader, key, urls, config, xhrSettings)
* @param {string} key - [description]
* @param {(string|string[])} urls - [description]
* @param {object} config - [description]
* @param {object} xhrSettings - [description]
* @param {object} [xhrSettings] - [description]
*
* @return {Phaser.Loader.LoaderPlugin} The Loader.
*/

View file

@ -24,8 +24,8 @@ var JSONFile = require('./JSONFile.js');
* @param {(string|string[])} urls - [description]
* @param {object} json - [description]
* @param {object} config - [description]
* @param {XHRSettingsObject} audioXhrSettings - Optional file specific XHR settings.
* @param {XHRSettingsObject} jsonXhrSettings - Optional file specific XHR settings.
* @param {XHRSettingsObject} [audioXhrSettings] - Optional file specific XHR settings.
* @param {XHRSettingsObject} [jsonXhrSettings] - Optional file specific XHR settings.
*
* @return {Phaser.Loader.LoaderPlugin} The Loader.
*/

View file

@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var BinaryFile = new Class({
@ -74,7 +74,7 @@ var BinaryFile = new Class({
*
* @param {string} key - [description]
* @param {string} url - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*
* @return {Phaser.Loader.LoaderPlugin} The Loader.
*/

View file

@ -18,8 +18,8 @@ var XMLFile = require('./XMLFile.js');
* @param {string} textureURL - The url to load the texture file from.
* @param {string} xmlURL - The url to load the atlas file from.
* @param {string} path - The path of the file.
* @param {XHRSettingsObject} textureXhrSettings - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} xmlXhrSettings - Optional atlas file specific XHR settings.
* @param {XHRSettingsObject} [textureXhrSettings] - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} [xmlXhrSettings] - Optional atlas file specific XHR settings.
*
* @return {object} An object containing two File objects to be added to the loader.
*/
@ -53,8 +53,8 @@ var BitmapFontFile = function (key, textureURL, xmlURL, path, textureXhrSettings
* @param {string} key - [description]
* @param {string} textureURL - [description]
* @param {string} xmlURL - [description]
* @param {XHRSettingsObject} textureXhrSettings - [description]
* @param {XHRSettingsObject} xmlXhrSettings - [description]
* @param {XHRSettingsObject} [textureXhrSettings] - [description]
* @param {XHRSettingsObject} [xmlXhrSettings] - [description]
*
* @return {Phaser.Loader.LoaderPlugin} The Loader.
*/

View file

@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var GLSLFile = new Class({
@ -74,7 +74,7 @@ var GLSLFile = new Class({
*
* @param {string} key - [description]
* @param {string} url - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*
* @return {Phaser.Loader.LoaderPlugin} The Loader.
*/

View file

@ -22,7 +22,7 @@ var GetURL = require('../GetURL');
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} config - [description]
* @param {XHRSettingsObject} [config] - [description]
*/
var HTML5AudioFile = new Class({

View file

@ -25,7 +25,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {number} width - [description]
* @param {number} height - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var HTMLFile = new Class({
@ -132,7 +132,7 @@ var HTMLFile = new Class({
* @param {string} url - [description]
* @param {number} width - [description]
* @param {number} height - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*
* @return {Phaser.Loader.LoaderPlugin} The Loader.
*/

View file

@ -23,8 +23,8 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {object} config - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
* @param {object} [config] - [description]
*/
var ImageFile = new Class({
@ -112,7 +112,7 @@ var ImageFile = new Class({
*
* @param {string} key - [description]
* @param {string} url - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*
* @return {Phaser.Loader.LoaderPlugin} The Loader.
*/

Some files were not shown because too many files have changed in this diff Show more