mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
Updated README and Change Log
This commit is contained in:
parent
9fdd7ab633
commit
17857fefa3
2 changed files with 40 additions and 97 deletions
|
@ -10,7 +10,7 @@ WebGL Pipelines are responsible for the rendering of all Game Objects in Phaser
|
|||
|
||||
#### Pipeline Manager
|
||||
|
||||
The `WebGL.PipelineManager` is a new class that is responsbile for managing all of the WebGL Pipelines in Phaser. An instance of the Pipeline Manager is created by the WebGL Renderer and is available under the `pipelines` property. This means that the WebGL Renderer no longer handles pipelines directly, causing the following API changes:
|
||||
The `WebGL.PipelineManager` is a new class that is responsible for managing all of the WebGL Pipelines in Phaser. An instance of the Pipeline Manager is created by the WebGL Renderer and is available under the `pipelines` property. This means that the WebGL Renderer no longer handles pipelines directly, causing the following API changes:
|
||||
|
||||
* `WebGLRenderer.pipelines` is no longer a plain object containing pipeline instances. It's now an instance of the `PipelineManager` class. This instance is created during the init and boot phase of the renderer.
|
||||
* The `WebGLRenderer.currentPipeline` property no longer exists, instead use `PipelineManager.current`.
|
||||
|
@ -29,7 +29,7 @@ The Pipeline Manager also offers the following new features:
|
|||
* The `PipelineManager.preRender` method calls the pre-render method of all pipelines.
|
||||
* The `PipelineManager.render` method calls the render method of all pipelines.
|
||||
* The `PipelineManager.postRender` method calls the post-render method of all pipelines.
|
||||
* The `PipelineManager.setMulti` method automatically binds the Multi Texture Pipeline, Phaser's default.
|
||||
* The `PipelineManager.setMulti` method automatically binds the Multi Texture Pipeline, Phasers default.
|
||||
* The `PipelineManager.clear` method will clear the pipeline, store it in `previous` and free the renderer.
|
||||
* The `PipelineManager.rebind` method will reset the rendering context and restore the `previous` pipeline, if set.
|
||||
* The `PipelineManager.copyFrame` method will copy a `source` Render Target to the `target` Render Target, optionally setting the brightness of the copy.
|
||||
|
@ -114,7 +114,7 @@ Further pipeline changes are as follows:
|
|||
* All pipelines will now extract the `attributes` property from the config, allowing you to set it externally.
|
||||
* All pipelines will now extract the `topology` property from the config, allowing you to set it externally.
|
||||
* The `WebGLPipeline.shouldFlush` method now accepts an optional parameter `amount`. If given, it will return `true` if the amount to be added to the vertex count exceeds the vertex capacity. The Multi Pipeline has been updated to now use this method instead of performing the comparison multiple times itself.
|
||||
* The `RopePipeline` now extends `MultiPipeline` and just changes the topology, vastly reducing the filesize.
|
||||
* The `RopePipeline` now extends `MultiPipeline` and just changes the topology, vastly reducing the file size.
|
||||
* The `WebGLPipeline.flushLocked` property has been removed. A pipeline can never flush in the middle of a flush anyway, so it was just wasting CPU cycles being set.
|
||||
* `WebGLPipeline.manager` is a new property that is a reference to the WebGL Pipeline Manager.
|
||||
* `WebGLPipeline.currentUnit` is a new property that holds the most recently assigned texture unit. Treat as read-only.
|
||||
|
@ -243,7 +243,6 @@ To support the new Post Pipelines in 3.50, the Pipeline Component which most Gam
|
|||
* `resetPostPipeline` is a new method that will specifically reset just the Post Pipelines, and optionally the pipeline data.
|
||||
* `removePostPipeline` is a new method that will destroy and remove the given Post Pipeline from the Game Object.
|
||||
|
||||
|
||||
#### Utility Pipeline
|
||||
|
||||
The Utility Pipeline is a brand new default special-use WebGL Pipeline that is created by and belongs to the Pipeline Manager.
|
||||
|
@ -339,8 +338,6 @@ As a result of these changes the following features are no longer available:
|
|||
|
||||
There is a new pipeline called `SinglePipeline`, created to emulate the old `TextureTintPipeline`. This special pipeline uses just a single texture and makes things a lot easier if you wish to create a custom pipeline, but not have to recode your shaders to work with multiple textures. Instead, just extend `SinglePipeline`, where-as before you extended the `TextureTintPipeline` and you won't have to change any of your shader code. However, if you can, you should update it to make it perform faster, but that choice is left up to you.
|
||||
|
||||
|
||||
|
||||
### WebGLShader
|
||||
|
||||
`WebGLShader` is a new class that is created and belongs to WebGL Pipeline classes. When the pipeline is created it will create a `WebGLShader` instance for each one of its shaders, as defined in the pipeline configuration.
|
||||
|
@ -498,7 +495,7 @@ All of the internal functions, such as `batchQuad` and `batchSprite` have been u
|
|||
* `WebGLRenderer.pushFramebuffer` is a new method that is used to push a framebuffer onto the fbo stack before setting it as the current framebuffer. This should now be called in place of `setFramebuffer`. Remember to call `popFramebuffer` after using it.
|
||||
* `WebGLRenderer.popFramebuffer` is a new method that will pop the current framebuffer off the fbo stack and set the previous one as being active.
|
||||
* `WebGLRenderer.setFramebuffer` has a new optional boolean parameter `resetTextures` which will reset the WebGL Textures, if set to `true` (which is the default).
|
||||
* `WebGLRenderer.isBooted` is a new boolean property that lets you know if the rendere has fully finished booting.
|
||||
* `WebGLRenderer.isBooted` is a new boolean property that lets you know if the renderer has fully finished booting.
|
||||
* The `WebGLRenderer` now extends the Event Emitter, allowing you to listen to renderer specific events.
|
||||
* `WebGLRenderer.defaultCamera` has been removed as it's not used anywhere internally any longer.
|
||||
* The `WebGLRenderer.setVertexBuffer` method has been removed along with the `WebGLRenderer.currentVertexBuffer` property. This is now set directly by the WebGL Pipeline, as needed.
|
||||
|
@ -536,7 +533,7 @@ The `ModelViewProjection` object contained a lot of functions that Phaser never
|
|||
|
||||
### WebGL and Canvas Renderer Events
|
||||
|
||||
* `Phaser.Renderer.Events` is a new namespace for events emited by the Canvas and WebGL Renderers.
|
||||
* `Phaser.Renderer.Events` is a new namespace for events emitted by the Canvas and WebGL Renderers.
|
||||
* `Renderer.Events.PRE_RENDER` is a new event dispatched by the Phaser Renderer. This happens right at the start of the render process.
|
||||
* `Renderer.Events.RENDER` is a new event dispatched by the Phaser Renderer. This happens once for every camera, in every Scene at the start of its render process.
|
||||
* `Renderer.Events.POST_RENDER` is a new event dispatched by the Phaser Renderer. This happens right at the end of the render process.
|
||||
|
@ -544,7 +541,7 @@ The `ModelViewProjection` object contained a lot of functions that Phaser never
|
|||
|
||||
### Canvas Renderer Updates
|
||||
|
||||
* `CanvasRenderer.isBooted` is a new boolean property that lets you know if the rendere has fully finished booting.
|
||||
* `CanvasRenderer.isBooted` is a new boolean property that lets you know if the renderer has fully finished booting.
|
||||
* The `CanvasRenderer` now extends the Event Emitter, allowing you to listen to renderer specific events.
|
||||
|
||||
### Camera - New Features, Updates and API Changes
|
||||
|
@ -631,10 +628,10 @@ Render Textures have the following bug fixes:
|
|||
|
||||
The Point Light Game Object is brand new in 3.50 and provides a way to add a point light effect into your game, without the expensive shader processing requirements of the traditional Light Game Object.
|
||||
|
||||
The difference is that the Point Light renders using a custom shader, designed to give the impression of a radial light source, of variable radius, intensity and color, in your game. However, unlike the Light Game Object, it does not impact any other Game Objects, or use their normal maps for calcuations. This makes them extremely fast to render compared to Lights
|
||||
The difference is that the Point Light renders using a custom shader, designed to give the impression of a radial light source, of variable radius, intensity and color, in your game. However, unlike the Light Game Object, it does not impact any other Game Objects, or use their normal maps for calculations. This makes them extremely fast to render compared to Lights
|
||||
and perfect for special effects, such as flickering torches or muzzle flashes.
|
||||
|
||||
For maximum performance you should batch Point Light Game Objects together. This means ensuring they follow each other consecutively on the display list. Ideally, use a Layer Game Object and then add just Point Lights to it, so that it can batch together the rendering of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in your game then it's perfectly safe to mix them into the dislay list as normal. However, if you're using a large number of them, please consider how they are mixed into the display list.
|
||||
For maximum performance you should batch Point Light Game Objects together. This means ensuring they follow each other consecutively on the display list. Ideally, use a Layer Game Object and then add just Point Lights to it, so that it can batch together the rendering of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in your game then it's perfectly safe to mix them into the display list as normal. However, if you're using a large number of them, please consider how they are mixed into the display list.
|
||||
|
||||
The renderer will automatically cull Point Lights. Those with a radius that does not intersect with the Camera will be skipped in the rendering list. This happens automatically and the culled state is refreshed every frame, for every camera.
|
||||
|
||||
|
@ -695,7 +692,7 @@ The Mesh Game Object has been rewritten from scratch in v3.50 with a lot of chan
|
|||
* `Mesh.vertices` is now an array of `GameObject.Vertex` instances, not a Float32Array.
|
||||
* `Mesh.faces` is a new array of `GameObject.Face` instances, which is populated during a call to methods like `addVertices` or `addModel`.
|
||||
* `Mesh.totalRendered` is a new property that holds the total number of Faces that were rendered in the previous frame.
|
||||
* `Mesh.setDebug` is a new method that allows you to render a debug visualisation of the Mesh vertices to a Graphics Game Object. You can provide your own Graphics instance and optionally callback that is invoked during rendering. This allows you to easily visualise the vertices of your Mesh to help debug UV mapping.
|
||||
* `Mesh.setDebug` is a new method that allows you to render a debug visualization of the Mesh vertices to a Graphics Game Object. You can provide your own Graphics instance and optionally callback that is invoked during rendering. This allows you to easily visualize the vertices of your Mesh to help debug UV mapping.
|
||||
* The Mesh now renders by iterating through the Faces array, not the vertices. This allows you to use Array methods such as `BringToTop` to reposition a Face, thus changing the drawing order without having to repopulate all of the vertices. Or, for a 3D model, you can now depth sort the Faces.
|
||||
* The `Mesh` Game Object now extends the `SingleAlpha` component and the alpha value is factored into the final alpha value per vertex during rendering. This means you can now set the whole alpha across the Mesh using the standard `setAlpha` methods. But, if you wish to, you can still control the alpha on a per-vertex basis as well.
|
||||
* The Mesh renderer will now check to see if the pipeline capacity has been exceeded for every Face added, allowing you to use Meshes with vertex counts that exceed the pipeline capacity without causing runtime errors.
|
||||
|
@ -784,7 +781,7 @@ The Animation API has had a significant overhaul to improve playback handling. I
|
|||
* `ANIMATION_STOP_EVENT` is a new event that is emitted from a Sprite when its current animation is stopped. This can happen if any of the `stop` methods are called, or a new animation is played prior to this one reaching completion. Fix #4894 (thanks @scott20145)
|
||||
* The Game Object `Component.Animation` component has been renamed to `AnimationState` and has moved namespace. It's now in `Phaser.Animations` instead of `GameObjects.Components` to help differentiate it from the `Animation` class when browsing the documentation.
|
||||
* The `play`, `playReverse`, `playAfterDelay`, `playAfterRepeat` and `chain` Sprite and Animation Component methods can now all take a `Phaser.Types.Animations.PlayAnimationConfig` configuration object, as well as a string, as the `key` parameter. This allows you to override any default animation setting with those defined in the config, giving you far greater control over animations on a Game Object level, without needing to globally duplicate them.
|
||||
* `AnimationState.create` is a new method that allows you to create animations directly on a Sprite. These are not global and never enter the Animation Manager, instead risiding within the Sprite itself. This allows you to use the same keys across both local and global animations and set-up Sprite specific local animations.
|
||||
* `AnimationState.create` is a new method that allows you to create animations directly on a Sprite. These are not global and never enter the Animation Manager, instead residing within the Sprite itself. This allows you to use the same keys across both local and global animations and set-up Sprite specific local animations.
|
||||
* `AnimationState.generateFrameNumbers` is a new method that is a proxy for the same method available under the Animation Manager. It's exposed in the Animation State so you're able to access it from within a Sprite (thanks @juanitogan)
|
||||
* `AnimationState.generateFrameNames` is a new method that is a proxy for the same method available under the Animation Manager. It's exposed in the Animation State so you're able to access it from within a Sprite (thanks @juanitogan)
|
||||
* All playback methods: `play`, `playReverse`, `playAfterDelay` and `playAfterRepeat` will now check to see if the given animation key exists locally on the Sprite first. If it does, it's used, otherwise it then checks the global Animation Manager for the key instead.
|
||||
|
@ -873,7 +870,7 @@ The Animation API has had a significant overhaul to improve playback handling. I
|
|||
* The `AnimationState.updateFrame` method has now been removed. Everything is handled by `setCurrentFrame` instead, which removes one extra step out of the update process.
|
||||
* `GenerateFrameNames` will now `console.warn` if the generated frame isn't present in the texture, which should help with debugging animation creation massively.
|
||||
* `GenerateFrameNumbers` will now `console.warn` if the generated frame isn't present in the texture, which should help with debugging animation creation massively.
|
||||
* `GenerateFrameNumbers` would include the __BASE frame by mistake in its calculations. This didn't end up in the final animation, but did cause a cache miss when building the animation.
|
||||
* `GenerateFrameNumbers` would include the `__BASE` frame by mistake in its calculations. This didn't end up in the final animation, but did cause a cache miss when building the animation.
|
||||
* `GenerateFrameNumbers` can now accept the `start` and `end` parameters in reverse order, meaning you can now do `{ start: 10, end: 1 }` to create the animation in reverse.
|
||||
* `GenerateFrameNames` can now accept the `start` and `end` parameters in reverse order, meaning you can now do `{ start: 10, end: 1 }` to create the animation in reverse.
|
||||
|
||||
|
@ -995,12 +992,12 @@ This has all changed in 3.50, as outlined below. Tint values are now used direct
|
|||
* As a result of the change to the shader, all uses of the WebGL Util function `getTintAppendFloatAlphaAndSwap` have been replaced with `getTintAppendFloatAlpha` instead.
|
||||
* As a result of the change to the shader, the Multi Pipeline now uses the `WebGLRenderer.whiteTexture` and `tintEffect` mode of 1 by default, instead of mode 2 (which has been removed) and a transparent texture. This ensures Graphics and Shapes objects still render correctly under the new smaller shader code.
|
||||
* `WebGLRenderer.whiteTexture` is a new property that is a reference to a pure white 4x4 texture that is created during Boot by the Texture Manager. The Graphics Pipeline uses this internally for all geometry fill rendering.
|
||||
* The `TextureManager` now generates a new texture with the key `__WHITE` durings its boot process. This is a pure white 4x4 texture used by the Graphics pipelines.
|
||||
* The `TextureManager` now generates a new texture with the key `__WHITE` during its boot process. This is a pure white 4x4 texture used by the Graphics pipelines.
|
||||
* `Config.images.white` is a new Game Config property that specifies the 4x4 white PNG texture used by Graphics rendering. You can override this via the config, but only do so if needed.
|
||||
|
||||
### Arcade Physics - New Features, API Changes and Bug Fixes
|
||||
|
||||
Prior to v3.50 an Arcade Physics Body could be one of two states: immovable, or moveable. An immovable body could not receive _any_ impact from another Body. If something collided with it, it wouldn't even separate to break free from the collision (the other body had to take the full separation value). It was intended for objects such as platforms, ground or walls, there they absolutely shouldn't move under any circumstances. As a result, two immovable bodies could never be collided together. While this worked for scenery-like items, it didn't work if you required maybe 2 players who could collide with each other, but should never be able to push one another. As of 3.50 all physics bodies now have a new property `pushable` that allows this. A pushable body can share separation with its collider, as well as take on mass-based velocity from the impact. A non-pushable body will behave differently depending on what it collides with. For example, a pushable body hitting a non-pushable (or immoveable) body will rebound off it.
|
||||
Prior to v3.50 an Arcade Physics Body could be one of two states: immovable, or movable. An immovable body could not receive _any_ impact from another Body. If something collided with it, it wouldn't even separate to break free from the collision (the other body had to take the full separation value). It was intended for objects such as platforms, ground or walls, there they absolutely shouldn't move under any circumstances. As a result, two immovable bodies could never be collided together. While this worked for scenery-like items, it didn't work if you required maybe 2 players who could collide with each other, but should never be able to push one another. As of 3.50 all physics bodies now have a new property `pushable` that allows this. A pushable body can share separation with its collider, as well as take on mass-based velocity from the impact. A non-pushable body will behave differently depending on what it collides with. For example, a pushable body hitting a non-pushable (or immovable) body will rebound off it.
|
||||
|
||||
* The Arcade Physics `Body` class has a new boolean property `pushable` (true, by default). This allows you to set if a Body can be physically pushed by another Body, or not. Fix #4175 #4415 (thanks @inmylo @CipSoft-Components)
|
||||
* `Body.setPushable` is a new chainable method that allows you to set the `pushable` state of a Body.
|
||||
|
|
108
README.md
108
README.md
|
@ -15,7 +15,7 @@ Thousands of developers from indie and multi-national digital agencies, and univ
|
|||
|
||||
**Visit:** The [Phaser website](https://phaser.io) and follow on [Twitter](https://twitter.com/phaser_) (#phaserjs)<br />
|
||||
**Learn:** [API Docs](https://photonstorm.github.io/phaser3-docs/index.html), [Support Forum][forum] and [StackOverflow](https://stackoverflow.com/questions/tagged/phaser-framework)<br />
|
||||
**Code:** 1700+ [Examples](https://phaser.io/examples) (source available in this [repo][examples])<br />
|
||||
**Code:** 1770+ [Examples](https://phaser.io/examples) (source available in this [repo][examples])<br />
|
||||
**Read:** The [Phaser World](#newsletter) Newsletter<br />
|
||||
**Discord:** Join us on [Discord](https://phaser.io/community/discord)<br />
|
||||
**Extend:** With [Phaser Plugins](https://phaser.io/shop/plugins)<br />
|
||||
|
@ -27,15 +27,21 @@ Grab the source and join the fun!
|
|||
|
||||
<div align="center"><img src="https://phaser.io/images/github/news.jpg"></div>
|
||||
|
||||
> 13th July 2020
|
||||
> 16th December 2020
|
||||
|
||||
I'm pleased to announce the immediate availability of Phaser 3.24. This release is primarily a maintenance release, with the focus mostly on bug fixes and updates. Even so, there are over 70 updates in this version alone. From improvements to the Arcade Physics system, to new Tween events and the ability to chain multiple animations, to some important fixes. If you're currently using 3.23 then we recommend this upgrade. As usual, I'd like to send my thanks to the Phaser community for their help in both reporting issues and submitting pull requests to fix them.
|
||||
After 13 beta releases, over 200 resolved issues, thousands of lines of new code and the culmination of over 6 months incredibly hard work, Phaser 3.50 is finally here.
|
||||
|
||||
So, please do spend some time digging through the [Change Log](#changelog). I assure you, it's worth while :)
|
||||
It's not hyperbole or exaggeration when I say that Phaser 3.50 is the single biggest point release ever in the history of Phaser. There are quite literally hundreds of new features to explore, updates to key areas and of course bug fixes. I did actually try counting all the changes, but gave up after I'd reached 900 of them! Thankfully, they are, as always, meticulously detailed in the [Change Log](https://github.com/photonstorm/phaser/blob/master/CHANGELOG-v3.50.md). The changes for 3.50 actually grew so large that I had to split them out from the main Change Log and put them into their own file.
|
||||
|
||||
I'd like to send a massive thank-you to everyone who supports [Phaser on Patreon](https://www.patreon.com/photonstorm) (and now even GitHub Sponsors, too!) Your continued backing keeps allowing me to work on Phaser full-time and this great new release is the very real result of that. If you've ever considered becoming a backer, now is the perfect time!
|
||||
However, don't let this overwhelm you. A massive number of the changes are purely internal and while there are absolutely some API breaking changes in this release (hence the large version number jump), we've kept them as sensible as possible. We already know of lots of devs who have upgraded with minimal, or no, changes to their actual game code. We cannot guarantee that for everyone, of course, but depending on how complex your game is, the chances are good.
|
||||
|
||||
As well as all of these updates, development has been progressing rapidly on Phaser 4. If you'd like to stay abreast of developments then I'm now publishing them to the [Phaser Patreon](https://www.patreon.com/photonstorm). Here you can find details about the latest developments and concepts behind Phaser 4.
|
||||
There is plenty to be excited about in this version. It pulls together most of the R&D that took place earlier this year for Phaser 4 and delivers it to you in version 3. New features include full support for post-processing effects via the new Post FX Pipeline, multi-texture support for faster WebGL rendering, a brand new Layer Game Object for the ability to group and post process objects without impacting their transforms, new event hooks, a massive overhaul of the Animation system, funky looking new Point Lights, a new Pipeline Manager, new Camera effects, the latest version of the Spine Plugin, an extremely powerful new Mesh Game Object, a brand new Render Texture, huge improvements to Bitmap Text, isometric and hexagonal Tilemap support, a new Pushable Arcade Physics Body type, new Geometry Intersection tests, Light 2D Updates and lots, lots, **lots** more!
|
||||
|
||||
As usual, I'd like to send my thanks to the Phaser community for their help in both reporting issues and submitting pull requests to fix them. So, please do spend some time digging through the [Change Log](#changelog). I assure you, it's worth while :)
|
||||
|
||||
I'd like to send a massive thank-you to everyone who supports [Phaser on Patreon](https://www.patreon.com/photonstorm), GitHub Sponsors and our corporate backers. Your continued funding allows me to keep working on Phaser full-time and this monster of a new release is the very real result of that. If you've ever considered becoming a backer, now is the perfect time!
|
||||
|
||||
If you'd like to stay abreast of developments then I'm now publishing them to the [Phaser Patreon](https://www.patreon.com/photonstorm). Here you can find the latest development reports including the concepts behind Phaser 4.
|
||||
|
||||
You can also follow Phaser on [Twitter](https://twitter.com/phaser_) and chat with fellow Phaser devs in our [Discord](https://phaser.io/community/discord).
|
||||
|
||||
|
@ -76,8 +82,9 @@ Extra special thanks to the following companies whose support makes Phaser possi
|
|||
* [Poki](https://developers.poki.com/)
|
||||
* [CrazyGames](https://www.crazygames.com)
|
||||
* [Lagged](https://www.lagged.com)
|
||||
* [Nakama](https://heroiclabs.com/nakama-opensource/)
|
||||
|
||||
![Sponsors](https://phaser.io/images/github/sponsors-2020-06.png "Our Awesome Sponsors")
|
||||
![Sponsors](https://phaser.io/images/github/sponsors-2020-12.png "Our Awesome Sponsors")
|
||||
|
||||
![Download Phaser](https://phaser.io/images/github/div-download.png "Download Phaser")
|
||||
<a name="download"></a>
|
||||
|
@ -103,13 +110,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.24.0/dist/phaser.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/phaser@3.50.0/dist/phaser.js"></script>
|
||||
```
|
||||
|
||||
or the minified version:
|
||||
|
||||
```html
|
||||
<script src="//cdn.jsdelivr.net/npm/phaser@3.24.0/dist/phaser.min.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/phaser@3.50.0/dist/phaser.min.js"></script>
|
||||
```
|
||||
|
||||
### API Documentation
|
||||
|
@ -118,7 +125,7 @@ Go to https://photonstorm.github.io/phaser3-docs/index.html to read the docs onl
|
|||
|
||||
Or, if you wish to run the docs locally you can checkout the [phaser3-docs](https://github.com/photonstorm/phaser3-docs) repository and then read the documentation by pointing your browser to the `docs/` folder.
|
||||
|
||||
The documentation for Phaser 3 is an on-going project. Please help us by searching the Phaser code for any instance of the string `[description]` and then replacing it with some documentation.
|
||||
The documentation for Phaser 3 is an on-going project. Please help us by contributing improved docs and examples.
|
||||
|
||||
### TypeScript Definitions
|
||||
|
||||
|
@ -181,7 +188,7 @@ Create an `index.html` page locally and paste the following code into it:
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/npm/phaser@3.24.0/dist/phaser-arcade-physics.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/phaser@3.50.0/dist/phaser-arcade-physics.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -218,7 +225,7 @@ var game = new Phaser.Game(config);
|
|||
|
||||
function preload ()
|
||||
{
|
||||
this.load.setBaseURL('http://labs.phaser.io');
|
||||
this.load.setBaseURL('https://labs.phaser.io');
|
||||
|
||||
this.load.image('sky', 'assets/skies/space3.png');
|
||||
this.load.image('logo', 'assets/sprites/phaser3-logo.png');
|
||||
|
@ -275,7 +282,7 @@ Ourcade have published [two great Phaser 3 books](https://blog.ourcade.co/). The
|
|||
|
||||
![Building Phaser](https://phaser.io/images/github/div-building-phaser.png "Building Phaser")
|
||||
|
||||
There are both plain and minified compiled versions of Phaser in the `dist` folder of the repository. The plain version is for use during development, and the minified version is for production use. You can also create your own builds.
|
||||
There are both plain and minified compiled versions of Phaser in the `dist` folder of the repository. The plain version is for use during development, and the minified version is for production use. You can and should also create your own builds.
|
||||
|
||||
### Custom Builds
|
||||
|
||||
|
@ -294,76 +301,15 @@ You can then run `webpack` to create a development build in the `build` folder w
|
|||
|
||||
# Change Log
|
||||
|
||||
## Version 3.24 - Rem - 13th July 2020
|
||||
Traditionally we have always included the most recent Change Log in this README. It was a nice quick way for visitors to scan what's new in the latest version. However, with the 3.50.0 release we cannot do that because the Change Log itself is 1300 lines long and over 160KB in size.
|
||||
|
||||
### Arcade Physics New Features, Updates and Fixes
|
||||
This is somewhat unprecedented for Phaser, but then 3.50 _is_ a truly massive release!
|
||||
|
||||
* When colliding physics groups with the search tree enabled, there was an unnecessary intersection test for each body returned by the search (thanks @samme)
|
||||
* When doing an overlap collision, there was an unnecessary intersection test for each pair of overlapping bodies (thanks @samme)
|
||||
* Sprite vs. Static Group collision tests now always use the static tree (thanks @samme)
|
||||
* Fixed a bug where if you added a static body to a sprite with scale ≠ 1, the body position was incorrect (thanks @samme)
|
||||
* If you passed in an array of `children` when creating a Physics Group, they didn't receive bodies. Fix #5152 (thanks @samme)
|
||||
* New types allow for better docs / TypeScript defs especially in the Factory functions: `ArcadePhysicsCallback`, `GameObjectWithBody`, `GameObjectWithDynamicBody`, `GameObjectWithStaticBody`, `ImageWithDynamicBody`, `ImageWithStaticBody`, `SpriteWithDynamicBody` and `SpriteWithStaticBody`. Fix #4994 (thanks @samme @gnesher)
|
||||
* `Body.updateFromGameObject` is a new method that extracts the relevant code from `preUpdate`, allowing you to read the body's new position and center immediately, before the next physics step. It also lets `refreshBody` work for dynamic bodies, where previously it would error (thanks @samme)
|
||||
* Momentum exchange wasn't working correctly vs. immovable bodies. The movable body tended to stop. Fix #4770 (thanks @samme)
|
||||
* The Body mass was decreasing the inertia instead of increasing it. Fix #4770 (thanks @samme)
|
||||
* The separation vector seemed to be incorrect, causing the slip / slide collisions. The separation is now correct for circle–circle collisions (although not fully for circle–rectangle collisions), part fix #4770 (thanks @samme)
|
||||
* The Arcade Body delta was incorrectly calculated on bodies created during the `update` step, causing the position to be off. Fix #5204 (thanks @zackexplosion @samme)
|
||||
* `Arcade.Components.Size.setBodySize` is a new method available on Arcade Physics Game Objects that allows you to set the body size. This replaces `setSize` which is now deprecated. Fix #4786 (thanks @wingyplus)
|
||||
You can read the whole [3.50 Change Log here](https://github.com/photonstorm/phaser/blob/master/CHANGELOG-v3.50.md).
|
||||
|
||||
### New Features
|
||||
We've organized the Change Log into commonly themed sections to make it more digestible, but we appreciate there is a lot in there. Please don't feel overwhelmed! If you need clarification about something, join us on the Phaser Discord and feel free to ask.
|
||||
|
||||
* The Animation component has a new property `nextAnimsQueue` which allows you to sequence Sprite animations to play in order, i.e: `this.mole.anims.play('digging').anims.chain('lifting').anims.chain('looking').anims.chain('lowering');` (thanks @tgroborsch)
|
||||
* `Group.setActive` is a new method that will set the active state of a Group, just like it does on other Game Objects (thanks @samme)
|
||||
* `Group.setName` is a new method that will set the name property of a Group, just like it does on other Game Objects (thanks @samme)
|
||||
* `TWEEN_STOP` is a new event dispatched by a Tween when it stops playback (thanks @samme @RollinSafary)
|
||||
* You can now specify an `onStop` callback when creating a Tween as part of the tween config, which is invoked when a Tween stops playback (thanks @samme @RollinSafary)
|
||||
* Previously, if you created a timeline and passed no tweens in the config, the timeline would be created but all config properties were ignored. Now the timeline's own properties (completeDelay, loop, loopDelay, useFrames, onStart, onUpdate, onLoop, onYoyo, onComplete, etc.) are set from the config properly (thanks @samme)
|
||||
* `TextStyle.wordWrapWidth` lets you set the maximum width of a line of text (thanks @mikewesthad)
|
||||
* `TextStyle.wordWrapCallback` is a custom function that will is responsible for wrapping the text (thanks @mikewesthad)
|
||||
* `TextStyle.wordWrapCallbackScope` is the scope that will be applied when the `wordWrapCallback` is invoked (thanks @mikewesthad)
|
||||
* `TextStyle.wordWrapUseAdvanced` controls whether or not to use the advanced wrapping algorithm (thanks @mikewesthad)
|
||||
* `KeyboardPlugin.removeAllKeys` is a new method that allows you to automatically remove all Key instances that the plugin has created, making house-keeping a little easier (thanks @samme)
|
||||
* `Math.RotateTo` is a new function that will position a point at the given angle and distance (thanks @samme)
|
||||
* `Display.Bounds.GetBounds` is a new function that will return the un-transformed bounds of the given Game Object as a Rectangle (thanks @samme)
|
||||
|
||||
### Updates
|
||||
|
||||
* The `Pointer.dragStartX/YGlobal` and `Pointer.dragX/Y` values are now populated from the `worldX/Y`, which means using those values directly in Input Drag callbacks will now work when the Camera is zoomed. Fix #4755 (thanks @braindx)
|
||||
* The `browser` field has been added to the Phaser `package.json` pointing to the `dist/phaser.js` umd build (thanks @FredKSchott)
|
||||
* Calling `TimeStep.wake()` while the loop is running will now cause nothing to happen, rather than sleeping and then waking again (thanks @samme)
|
||||
* `Container.getBounds` will no longer set the temp rect bounds to the first child of the Container by default (which would error if the child had no bounds, like a Graphics object) and instead sets it as it iterates the children (thanks @blopa)
|
||||
* `File.state` will now be set to the `FILE_LOADING` state while loading and `FILE_LOADED` after loading (thanks @samme)
|
||||
* `BaseCamera.cull` now moves some of its calculations outside of the cull loop to speed it up (thanks @samme)
|
||||
* `SceneManager.createSceneFromInstance` had a small refactor to avoid a pointless condition (thanks @samme)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixed a TypeError warning when importing JSON objects directly to the `url` argument of any of the Loader filetypes. Fix #5189 (thanks @awweather @samme)
|
||||
* The `NOOP` function was incorrectly imported by the Mouse and Keyboard Manager. Fix #5170 (thanks @samme @gregolai)
|
||||
* When Audio files failed to decode on loading, they would always show 'undefined' as the key in the error log, now they show the actual key (thanks @samme)
|
||||
* When the Sprite Sheet parser results in zero frames, the warning will now tell you the texture name that caused it (thanks @samme)
|
||||
* `KeyboardPlugin.checkDown` didn't set the `duration` to zero if the parameter was omitted, causing it to always return false. Fix #5146 (thanks @lozzajp)
|
||||
* If you passed in an array of `children` when creating a Group, they were not added and removed correctly. Fix #5151 (thanks @samme)
|
||||
* When using HTML5 Audio with `pauseOnBlur` (the default), if you play a sound, schedule stopping the sound (e.g., timer, tween complete callback), leave the page, and return to the page, the sound `stop()` will error (thanks @samme)
|
||||
* Using a Render Texture when you're also using the headless renderer would cause an error (thanks @samme)
|
||||
* `Ellipse.setWidth` would incorrectly set the `xRadius` to the diameter (thanks @rexrainbow)
|
||||
* `Ellipse.setHeight` would incorrectly set the `yRadius` to the diameter (thanks @rexrainbow)
|
||||
* When specifically setting the `parent` property in the Game Config to `null` the canvas was appended to the document body, when it should have been ignored (allowing you to add it to the dom directly). Fix #5191 (thanks @MerganThePirate)
|
||||
* Containers will now apply nested masks correctly when using the Canvas Renderer specifically (thanks @scott20145)
|
||||
* Calling `Scale.startFullScreen` would fail in Safari on Mac OS, throwing a `fullscreenfailed` error. It now triggers fullscreen mode correctly, as on other browsers. Fix #5143 (thanks @samme @novaknole)
|
||||
* Calling `setCrop` on a Matter Physics Sprite would throw a TypeError, but will now crop correctly. Not that it only crops the texture, the body is unaffected. Fix #5211 (thanks @MatthewRorke @samme)
|
||||
* The Static Tilemap Layer would ignore the layer rotation and parent transform when using WebGL (but worked in Canvas). Both modes now work in the same manner (thanks @cruzdanilo)
|
||||
* Calling `getTextBounds` on a BitmapText object would return the incorrect values if the origin had been changed, but the text itself had not, as it was using out of date dimensions. Changing the origin now automatically triggers BitmapText to be dirty, forcing the bounds to be refreshed. Fix #5121 (thanks @thenonamezz)
|
||||
* The ISO Triangle shape would skip rendering the left side of the first triangle in the batch. It now renders all ISO Triangles correctly. Fix #5164 (thanks @mattjennings)
|
||||
|
||||
### Examples, Documentation and TypeScript
|
||||
|
||||
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
|
||||
|
||||
@samme @SanderVanhove @SirJosh3917 @mooreInteractive @A-312 @lozzajp @mikewesthad @j-waters @futuremarc
|
||||
|
||||
Please see the complete [Change Log](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md) for previous releases.
|
||||
For versions prior to 3.50 you can read the previous [Change Log](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md) as well.
|
||||
|
||||
![Contributing](https://phaser.io/images/github/div-contributing.png "Contributing")
|
||||
<a name="contributing"></a>
|
||||
|
@ -392,8 +338,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.24.0/phaser.js
|
||||
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v3.24.0/phaser.min.js
|
||||
[get-js]: https://github.com/photonstorm/phaser/releases/download/v3.50.0/phaser.js
|
||||
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v3.50.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
|
||||
|
|
Loading…
Reference in a new issue