mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 09:27:37 +00:00
Update CHANGELOG-v3.60.md
This commit is contained in:
parent
d44db46253
commit
2d86cb2c1e
1 changed files with 59 additions and 0 deletions
|
@ -1,5 +1,63 @@
|
|||
## Version 3.60.0 - Miku - in development
|
||||
|
||||
### New Features - Nine Slice Game Object
|
||||
|
||||
Phaser 3.60 contains a new native Nine Slice Game Object. A Nine Slice Game Object allows you to display a texture-based object that can be stretched both horizontally and vertically, but that retains fixed-sized corners. The dimensions of the corners are set via the parameters to the class. When you resize a Nine Slice Game Object only the middle sections of the texture stretch. This is extremely useful for UI and button-like elements, where you need them to expand to accomodate the content without distorting the texture.
|
||||
|
||||
The texture you provide for this Game Object should be based on the following layout structure:
|
||||
|
||||
```
|
||||
A B
|
||||
+---+----------------------+---+
|
||||
C | 1 | 2 | 3 |
|
||||
+---+----------------------+---+
|
||||
| | | |
|
||||
| 4 | 5 | 6 |
|
||||
| | | |
|
||||
+---+----------------------+---+
|
||||
D | 7 | 8 | 9 |
|
||||
+---+----------------------+---+
|
||||
```
|
||||
|
||||
When changing this objects width and / or height:
|
||||
|
||||
areas 1, 3, 7 and 9 (the corners) will remain unscaled
|
||||
areas 2 and 8 will be stretched horizontally only
|
||||
areas 4 and 6 will be stretched vertically only
|
||||
area 5 will be stretched both horizontally and vertically
|
||||
|
||||
You can also create a 3 slice Game Object:
|
||||
|
||||
This works in a similar way, except you can only stretch it horizontally. Therefore, it requires less configuration:
|
||||
|
||||
```
|
||||
A B
|
||||
+---+----------------------+---+
|
||||
| | | |
|
||||
C | 1 | 2 | 3 |
|
||||
| | | |
|
||||
+---+----------------------+---+
|
||||
```
|
||||
|
||||
When changing this objects width (you cannot change its height)
|
||||
|
||||
areas 1 and 3 will remain unscaled
|
||||
area 2 will be stretched horizontally
|
||||
|
||||
The above configuration concept is adapted from the Pixi NiceSlicePlane.
|
||||
|
||||
To specify a 3 slice object instead of a 9 slice you should only provide the `leftWidth` and `rightWidth` parameters. To create a 9 slice
|
||||
you must supply all parameters.
|
||||
|
||||
The _minimum_ width this Game Object can be is the total of `leftWidth` + `rightWidth`. The _minimum_ height this Game Object
|
||||
can be is the total of `topHeight` + `bottomHeight`. If you need to display this object at a smaller size, you can scale it.
|
||||
|
||||
In terms of performance, using a 3 slice Game Object is the equivalent of having 3 Sprites in a row. Using a 9 slice Game Object is the equivalent
|
||||
of having 9 Sprites in a row. The vertices of this object are all batched together and can co-exist with other Sprites and graphics on the display
|
||||
list, without incurring any additional overhead.
|
||||
|
||||
As of Phaser 3.60 this Game Object is WebGL only. Please see the new examples and documentation for how to use it.
|
||||
|
||||
### New Features - Sprite FX
|
||||
|
||||
* When defining the `renderTargets` in a WebGL Pipeline config, you can now set optional `width` and `height` properties, which will create a Render Target of that exact size, ignoring the `scale` value (if also given).
|
||||
|
@ -443,6 +501,7 @@ The following are API-breaking, in that a new optional parameter has been insert
|
|||
|
||||
### Bug Fixes
|
||||
|
||||
* The `Actions.Spread` method will now place the final item correctly and abort early if the array only contains 1 or 0 items (thanks @EmilSV)
|
||||
* Calling `setDisplayOrigin` on a `Video` Game Object would cause the origins to be set to `NaN` if the Video was created without an asset key. It will now give Videos a default size, preventing this error, which is reset once a video is loaded. Fix #5560 (thanks @mattjennings)
|
||||
* When `ImageFile` loads with a linked Normal Map and the map completes first, but the Image is still in a pending state, it would incorrectly add itself to the cache instead of waiting. It now checks this process more carefully. Fix #5886 (thanks @inmylo)
|
||||
* Using a `dataKey` to specify a part of a JSON file when using `load.pack` would fail as it wouldn't correctly assign the right part of the pack file to the Loader. You can now use this parameter properly. Fix #6001 (thanks @rexrainbow)
|
||||
|
|
Loading…
Reference in a new issue