Navigation

Phaser 2.6 Released

Published on 8th July 2016

image

Phaser 2.6.0 is released. This is essentially the 2.5.1 version, but with some API changing features added, causing the bump to 2.6. It's a significant update yet again, as a quick scan of the Change Log will show. A few of my personal favourite new features are:

Arcade Physics support for Circle shaped bodies. This is something I started work on a while ago, then put on the shelf as I focused on other things. Along came VitaZheltyakov who finished it off - adding in the intersection calls needed. I took his work, modified it a bit and voila - we have circle to circle, and circle to rect collisions :) You can see how to use it in this example.

New Arcade Physics Signals. I hang out in the Phaser Slack channel every week day, and something that was discussed recently was a way to tell when a Body collides with the World bounds, not just another Body. I had a quick think, implemented it, wrote a test - and bosh! Another tiny little change, but a substantial feature. Here's an example showing it. As well as signals for world bounds, I also added 'onCollide' and 'onOverlap' signals too. These provide alternative means to the more usual collide callback that you'd traditionally use.

Again as a result of Slack, someone asked how to 'hide' a part of a Sprite. The answer of course is to use a mask, but they're not that well covered, so I knocked up these quick examples of masking a Sprite, and also of masking a whole Group.

Group Alignment. The spent a good while pimping out the 'bounds' related functions in the 2.5.0 release for Sprites. You can now easily align sprites within the world, each other, or any rectangle. This allows for what was previously quite complex layout code to be reduced to a few calls. In the 2.6.0 release I extended this support to Groups as well. So you can now easily align Groups, no matter how their children are positioned, using the new properties like 'left', 'centerX' and methods like 'alignIn' and 'alignTo'.

Pixi updates

You'll notice a huge load of changes to Pixi in this release. This is basically house-keeping work. I've been removing functions that are never used internally, and are just wasting space - or worse, causing bugs (like the TextureCache arrays not being properly cleared). This doesn't impact Phaser at all, but if you have any plugins that rely on certain Pixi features, then please check they still work with 2.6.0.