mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 10:33:35 +00:00
5 KiB
5 KiB
Phaser 3.60.0 Change Log
Return to the Change Log index.
Group, Layer and Game Object New Features
- When using
Group.createMultiple
it will now skip the post-creations options if they are not set in the config object used, or a Game Object constructor. Previously, things like alpha, position, etc would be over-written by the defaults if they weren't given in the config, but now the method will check to see if they are set and only use them if they are. This is a breaking change, but makes it more efficient and flexible (thanks @samme) GameObjects.Layer.addToDisplayList
andremoveFromDisplayList
are new methods that allows for you to now add a Layer as a child of another Layer. Fix #5799 (thanks @samme)GameObjects.Polygon.setTo
is a new method that allows you to change the points being used to render a Polygon Shape Game Object. Fix #6151 (thanks @PhaserEditor2D)
Game Object Updates
- The
GameObject.getBounds
method will now return aGeom.Rectangle
instance, rather than a plain Object (thanks @samme) - The
GetBounds.getCenter
method now has an optionalincludeParent
argument, which allows you to get the value in world space. - The
Transform
Component has a new boolean read-only propertyhasTransformComponent
which is set totrue
by default.
DOM Element Game Object Updates
- The
DOMElement.preUpdate
method has been removed. If you overrode this method, please now seepreRender
instead. DOMElement.preRender
is a new method that will check parent visibility and improve its behavior, responding to the parent even if the Scene is paused or the element is inactive. Dom Elements are also no longer added to the Scene Update List. Fix #5816 (thanks @prakol16 @samme)
Light Game Object Updates
- The
Light
Game Object now has theOrigin
andTransform
components, along with 4 new properties:width
,height
,displayWidth
anddisplayHeight
. This allows you to add a Light to a Container, or enable it for physics. Fix #6126 (thanks @jcoppage)
Transform Matrix Updates
TransformMatrix.setQuad
is a new method that will perform the 8 calculations required to create the vertice positions from the matrix and the given values. The result is stored in the newTransformMatrix.quad
Float32Array, which is also returned from this method.TransformMatrix.multiply
now directly updates the Float32Array, leading to 6 less getter invocations.
Game Object Bug Fixes
- The
renderFlags
property, used to determine if a Game Object will render, or not, would be calculated incorrectly depending on the order of thescaleX
andscaleY
properties. It now works regardless of the order (thanks @mizunokazumi) - When calling
GameObject.getPostPipeline
and passing in a string for the pipeline name it would error with 'Uncaught TypeError: Right-hand side of 'instanceof' is not an object'. This is now handled correctly internally (thanks @neki-dev) - The
GameObject.willRender
method will now factor in the parentdisplayList
, if it has one, to the end result. This fixes issues like that where an invisible Layer will still process input events. Fix #5883 (thanks @rexrainbow) - The
GetBounds
component has been removed from the Point Light Game Object. Fix #5934 (thanks @x-wk @samme) - Although not recommended, when adding a
Layer
Game Object to anotherLayer
Game Object, it will no longer error because it cannot find theremoveFromDisplayList
function. Fix #5595 (thanks @tringcooler) - The DisplayList will now enter a while loop until all Game Objects are destroyed, rather than cache the list length. This prevents "cannot read property 'destroy' of undefined" errors in Scenes. Fix #5520 (thanks @schontz @astei)
- Layers will now destroy more carefully when children destroy themselves (thanks @rexrainbow)
- The
DisplayList.addChildCallback
method will now check to see if the child has a parent container, and if it does, remove it from there before adding it to the Scene Display List. Fix #6091 (thanks @michalfialadev)
Rope Game Object Bug Fixes
- If
Rope.setPoints
was called with the exact same number of points as before, it wouldn't set thedirty
flag, meaning the vertices were not updated on the next render (thanks @stupot)
Rectangle Game Object Bug Fixes
- During a call to
GameObject.Shapes.Rectangle.setSize
it will now correctly update the Rectangle object's display origin and default hitArea (thanks @rexrainbow)
Path Follower Game Object Bug Fixes
- If you start a
PathFollower
with ato
value it will now tween and complete at that value, rather than the end of the path as before (thanks @samme)
Polygon Game Object Bug Fixes
- The
Polygon
Game Object would ignore itsclosePath
property when rendering in Canvas. Fix #5983 (thanks @optimumsuave)
Return to the Change Log index.
📖 Read the Phaser 3 API Docs 💻 Browse 2000+ Code Examples 🤝 Join the awesome Phaser Discord