A Guide to the Phaser Tween Manager (The Book + Code)
Minimum price
Suggested price

A Guide to the Phaser Tween Manager

About the Book

Tweens have long been a staple of games. Used for all kinds of things, from making scenes fade out, to bouncing in logos to blending sounds. Phaser has a built in Tween Manager capable of doing these things and a lot more. This guide details in depth the different aspects of the Tween Manager, creating and using Tweens, setting all of their properties and lots more. You can see the full table of contents list below.

I have to confess that when I started out writing this book I had no idea it would end-up being quite as large as it turned out. I mean you're probably thinking you already know how to use tweens pretty well, and why would you possibly need a book about it?! But the tween system changed significantly in Phaser 2.2. It gained a lot of interesting new features and in order to explain it all properly, with plenty of interesting examples, I ended-up writing 120+ pages worth of content.

There is also an optional source code package available with over 65 example pieces of source code, in easy ready to run html files. Please see this forum thread for details and screen shots.

It covers using tweens in ways you may not have considered before, how to use the new tween timeline system in Phaser 2.2, how to chain multiple tweens together, respond to their events and cache them for re-use. The final section goes through 8 complete source examples and a full game.

Hopefully by the end of it you'll be left with lots of ideas that will inspire you to use them in more creative and unusual ways.

Happy tweening!

About the Author

Richard Davey
Richard Davey

Richard Davey is the lead developer of the Phaser game framework and long-time HTML5 gaming advocate.


The Book + Code

This bundle includes the book and full source code archive.

  • PDF

  • EPUB

  • WEB

  • English

Minimum price
Suggested price
The Book
  • PDF

  • EPUB

  • WEB

  • English

Minimum price
Suggested price

Table of Contents

  • Welcome
  • What are tweens?
  • How Phaser manages tweens internally
    • Source Files
  • Creating a Tween
    • The Target Object to be Tweened
    • Tween.to
    • Tween.from
    • TweenData Objects
  • Tween Settings
    • Tween Properties
    • Tween Duration
    • Tween Ease
    • Phaser.Easing method to short-code table
    • Tween autoStart
    • Tween Delay
    • Tween Repeat
    • Tween Yoyo
  • Easing
    • Linear
    • Back
    • Bounce
    • Circular
    • Cubic
    • Elastic
    • Exponential
    • Quadratic
    • Quartic
    • Quintic
    • Sinusoidal
  • Tween Events
    • onStart
    • onRepeat
    • onLoop
    • onChildComplete
    • onComplete
  • The Tween Timeline
    • Repeat the whole timeline
    • Looping the whole timeline
    • Reverse the timeline during playback
    • Adjusting the playback time scale
  • Tweening multiple properties
    • Multi-tween Timelines
  • Chaining multiple Tweens
    • Long Chains
  • Generate Tween Data
  • Source Code Examples
    • Example 1 - Position
    • Example 2 - Scale
    • Example 3 - Alpha
    • Example 4 - Rotation
    • Example 5 - Game Scores
    • Example 6 - TileSprite Position and Scale
    • Example 7 - WebGL Shaders / Filters
    • Example 8 - Colors
    • Full Game Example
  • Credits

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub