Due to the rapid pace of change some links or details may no longer be correct.

Published in Phaser World Issue 72 on 17th March 2017 by Richard Davey   @photonstorm

New Text Game Object and Trail Effects


Last week I mentioned that we were going to work on some games this week, to see what gaps in the current API it would highlight. As it turned out, it highlighted so many that neither of us finished a game at all, which is both frustrating and extremely useful in equal measure.

Felipe was trying to get a 'trail effect' coming out the back of an asteroids style space ship. It was using the triangle feature of the Graphics class. Under this use it flagged up a bug whereby the end points of the triangles would incorrectly join to the first due to an error in the line width handling, causing an interesting graphical mess on-screen. So time was spent fixing this. He then wanted to add in the ability for trail colors, which also took time, along with other small fixes as the week progressed. So, no game, but a pretty sweet fruit ninja style slashing effect at least:


On my side I started on a little game, wanted to add some text to it, but we only had BitmapText finished and I wanted to use Text instead. So I spent time converting the Text game object over and getting it rendering. But of course it's not quite as simple as just copying code over. And I ended up spending a good amount of time planning out how the new Text Game Objects would work. Splitting off the style related functions (like setting up a shadow, or changing the line alignment) into their own new TextStyle class, and optimising the canvas text measuring routines.

I'm very pleased with the end result. It's fast, flexible and so much more cleaner than in v2. Yet the time it took meant I ran out of time to make my game as well. We do however now have a powerful static Text class and I created a number of examples to go with it too. Definitely more useful, but a little deflating.

Crunch Time

I'm very pleased to say that this week I completed the last of my client projects for the year, and I've now booked in Phaser 3 development to be my sole focus for the next 3 months. While Felipe has always been dedicated to v3 work (the money from our awesome patrons covering that), I had to maintain contract work as well, often focusing on project work during the day, and cramming in as much Phaser as I could manage in the evenings, and while waiting for feedback and QA reports.

I know this isn't an unusual situation, it's something a lot of you with your own open source projects have to do too. But now is the time to buckle down and dedicate myself 100% to it. I've saved enough income to ensure I can manage this without worrying, and honestly I'm really excited to get started :)

I'm aware that the word 'crunch' has a lot of negative connotations in the dev world, but let's be clear here: it doesn't mean doing a death march, or running myself into the ground. It just means being absolutely dedicated to getting v3 released, and not having to swap back to other projects as we go.

Phaser 3 Mailing List and Developers Guide

If you're interested in helping evolve the shape of Phaser 3, then please join the Phaser 3 Google Group. Discussions this week have included varying render loops. The group is for anyone who wishes to help shape what the Phaser 3 API and feature-set will contain.

The Phaser 3 Developers Guide is available. Essential reading for anyone who'd like to help build Phaser 3.