|
| 1 | +# Version 4.0 - beta 7 |
| 2 | + |
| 3 | +## Major Changes |
| 4 | + |
| 5 | +- Camera System Rewrite |
| 6 | + |
| 7 | +The camera system rewrite changes the way camera matrices are calculated. |
| 8 | + |
| 9 | +The Phaser 3 camera combined position, rotation, and zoom into `Camera#matrix`. Camera scroll was appended later. |
| 10 | + |
| 11 | +The new camera system uses two matrices. `Camera#matrix` is now a combination of rotation, zoom, and scroll. A new `Camera#matrixExternal` property includes camera position. This allows us to cleanly divide the view from the position. |
| 12 | + |
| 13 | +This change doesn't affect how you set camera properties to change the view. It mostly affects internal systems. However, if you use camera matrices directly, be aware that they have changed. |
| 14 | + |
| 15 | +- `Camera#matrix` now includes scroll, and excludes position. |
| 16 | +- `Camera#matrixExternal` is a new matrix, which includes the position. |
| 17 | +- `Camera#matrixCombined` is the multiplication of `matrix` and `matrixExternal`. This is sometimes relevant. |
| 18 | +- The `GetCalcMatrix(src, camera, parentMatrix, ignoreCameraPosition)` method now takes `ignoreCameraPosition`, causing its return value to use the identity matrix instead of the camera's position. |
| 19 | +- `GetCalcMatrixResults` now includes a `matrixExternal` property, and factors scroll into the `camera` and `calc` matrices. |
| 20 | +- To get a copy of a matrix with scroll factor applied, use `TransformMatrix#copyWithScrollFactorFrom(matrix, scrollX, scrollY, scrollFactorX, scrollFactorY)`. This generally replaces cases where phrases such as `spriteMatrix.e -= camera.scrollX * src.scrollFactorX` were used. |
| 21 | + |
| 22 | +The new system fixes many issues with nested transforms, filters, and other uses of transforms. |
| 23 | + |
| 24 | +## Minor Additions |
| 25 | + |
| 26 | +- Add documentation explaining how to modify a `SpriteGPULayer` efficiently. |
| 27 | +- Add `SpriteGPULayer#insertMembers` method. |
| 28 | +- Add `SpriteGPULayer#insertMembersData` method. |
| 29 | +- Add `SpriteGPULayer#getDataByteSize` method. |
| 30 | +- Add non-looping animations to `SpriteGPULayer` (set animation to `loop: false`) to support one-time particle effects and dynamic sources. |
| 31 | +- Add creation time to `SpriteGPULayer` members. |
| 32 | +- Add documentation for writing a `Extern#render` function. |
| 33 | +- `TilemapLayer` and `TilemapGPULayer` now support a parent matrix during rendering. |
| 34 | + |
| 35 | +## Fixes and Tweaks |
| 36 | + |
| 37 | +- Fix missing reference to Renderer events in `BatchHandler` (thanks @mikuso) |
| 38 | +- Fix `SpriteGPULayer` segment handling (segments changed from 32 to 24 to avoid problems with 32-bit number processing) |
| 39 | +- Allow negative acceleration in `SpriteGPULayer` member animations using Gravity. |
| 40 | +- Rearrange `SpriteGPULayer` data encoding. |
| 41 | +- Fix `SpriteGPULayer` failing to generate frame animations from config objects. |
| 42 | +- Allow `TextureSource#setFlipY` to affect all textures (except compressed textures, which have fixed orientation). |
| 43 | +- `WebGLProgramWrapper` now correctly recognizes uniforms with a value of `undefined` and can recognize if they have not changed and do not need updates. |
| 44 | +- Set `roundPixels` game option to `false` by default. It's very easy to get messy results with this option, but it remains available for use cases where it is necessary. |
| 45 | +- Throw an error if `DOMElement` has no container. |
| 46 | +- Fix `TileSprite` applying `smoothPixelArt` game option incorrectly. |
0 commit comments