Introducing the “Starling” book from O’Reilly

Introducing StarlingA few months ago, I was excited to share with you the birth of Starling, the new 2D GPU framework for Flash. I am happy to announce that the tutorial book I wrote is now published by O'Reilly and available for free as a PDF on O'Reilly website. This should be a good guide if you want to get started with Starling or if some developers you know would like to have a deeper look at it.

Description of the book from O'Reilly:

Starling is an ActionScript 3 2D framework developed on top of the Stage3D APIs (available on desktop in Flash Player 11 and Adobe AIR 3). Starling is mainly designed for game development, but could be used for many other use cases. Starling makes it possible to write fast GPU accelerated applications without having to touch the low-level Stage3D APIs.

Most Flash developers want to be able to leverage GPU acceleration (through Stage3D) without the need to write such higher-level frameworks and dig into the low-level Stage3D APIs. Starling is completely designed after the Flash Player APIs and abstracts the complexity of Stage3D (Molehill) and allows easy and intuitive programming for everyone.

Obviously Starling is for ActionScript 3 developers, especially those involved in 2D game development; of course you will need to have a basic understanding of ActionScript 3. By its design (lightweight, flexible and simple), Starling can be used also be used for other use cases like UI programming. That said, everything is designed to be as intuitive as possible, so any Java™ or .Net™ developer will get the hang of it quickly as well.

Here is the table of content of the book:

  • What Is Starling? 1
  • Why Starling? 1
  • Philosophy 1
    • Intuitive 1
    • Lightweight 2
    • Free 2
  • How
  • Layering Restrictions 7
  • Getting Started 8
  • Setting Up Your Scene 9
  • Wmode Requirements 13
  • Stage Quality 14
  • Progressive Enhancements 14
  • The Display List 15
  • Event Model 29
    • Event Propagation 29
  • Touch Events 30
    • Simulating Multi-touch 32
  • Texture 35
    • Image 37
    • Compressed Textures 47
    • Collision Detection 52
    • Drawing API 56
    • Filters 60
  • MovieClip 65
  • Optimizing for Performance 71
    • Release Build 72
    • CPU bound vs GPU bound 72
    • ActionScript optimizations 72
    • Running hardware accelerated 75
    • State changes 76
    • The painter's algorithm 77
    • Texture Atlas 77
    • Flat sprites 84
    • Batching with the QuadBatch API 87
    • Disable blending 88
    • Use Stage.color 89
    • Accessing Width and Height 89
    • Disable Interactivity 89
    • Optimized Event Model 90
    • Handle Lost Context 90
  • Juggler 90
  • Button 93
  • TextField 102
    • Embedded Fonts 105
    • Native Display List Overlay 108
    • Bitmap Fonts 109
  • RenderTexture 118
  • Tweens 120
  • Asset Management 124
  • Multi Resolution Development 125
    • Static Approach 126
    • Dynamic Approach 129
  • Handling Screen Resizes 130
  • Plugging Starling with Robotlegs 132
  • Plugging Starling with Box2D 132
  • Particles 136

The book is now referenced on the Starling website. Many thanks to Rich Tretola for making this happen with O'Reilly.

Comments (25)

  1. Great resource! Thanks for making it free. I’ve been using the “rough draft” for the past few weeks and its been essential.

    Saturday, January 14, 2012 at 3:47 am #
  2. ZanuZawa wrote:

    Thanks for this great starling ebook :)

    Saturday, January 14, 2012 at 5:24 am #
  3. Great stuff, thanks for this! Downloaded and looking forward to read it.

    On a side note: Would it be possible for you guys to fix the new AS3 Sound API?

    Saturday, January 14, 2012 at 9:02 am #
  4. Eduardo wrote:

    Thank you for sharing this for free! I am sure a lot of great apps will be inspired by it.

    Saturday, January 14, 2012 at 2:20 pm #
  5. Khaled wrote:

    thank you ver much for this book !

    Sunday, January 15, 2012 at 3:29 pm #
  6. clark wrote:

    This is really far too cool.

    Thanks for taking the time to write about this (and provide it free!!!!)

    Sunday, January 15, 2012 at 11:18 pm #
  7. benbalogna wrote:

    Thanks for offering digital version for free! Cant wait to read this!

    Sunday, January 15, 2012 at 11:28 pm #
  8. ArulPrasad wrote:

    Thanks for the book, Thibault! Gave me and my teammate the much needed headstart on Starling!

    There’s a couple of invalid hyperlinks in this blogpost, by the way; The ” the birth of Starling..” one and “The book is now referenced on the Starling website. ” bit.

    Monday, January 16, 2012 at 7:10 am #
  9. Thibault Imbert wrote:

    Hi everyone,

    Happy you like it!

    Hi Arul,

    Thanks for the heads up for the links. Fixed!


    Monday, January 16, 2012 at 11:34 am #
  10. Mark wrote:

    The link to the starling site is broken, it is missing ‘http://’ in the href.

    Monday, January 16, 2012 at 11:58 am #
  11. Thibault Imbert wrote:

    Hi Mark,

    Fixed! Thanks. Don’t know what happened with the links!


    Monday, January 16, 2012 at 12:53 pm #
  12. Thankyou, signed up for o’reilly, and having a look at it now. This should come in very handy for my next project.

    Monday, January 16, 2012 at 11:06 pm #
  13. Poco wrote:

    Thanks for the book, Thibault! Much appreciated. However, I already got stuck on page 9:
    addChild(new Stats()) ? What’s that for a class, which package is it in? Or is it something we should programme ourselves?

    Tuesday, January 17, 2012 at 1:10 am #
  14. Travis wrote:

    Awesome thanks a ton! Digging into it right now.


    Tuesday, January 17, 2012 at 10:14 am #
  15. matan wrote:

    is there any change to get a link to the books code examples and assets?

    Tuesday, January 17, 2012 at 1:35 pm #
  16. Davide wrote:

    Great material. The introduction to starling is a must have to use starling.

    Please, consider to add the bitmapData class to starling too, as well as function like copypixel, getpixel and so on…

    Thursday, January 19, 2012 at 4:38 pm #
  17. drpelz wrote:

    Will there be a softcover edition?

    Monday, March 5, 2012 at 1:57 am #
  18. Qusai wrote:

    Thanks , Great efforts!

    can you provide us with the examples , please ?

    Wednesday, March 28, 2012 at 7:54 pm #
  19. Thibault Imbert wrote:

    Hi Poco,

    Yes it was an errata, it is now fixed in the latest version online. Sorry about that.


    Saturday, May 19, 2012 at 2:05 am #
  20. Thibault Imbert wrote:

    Hi Qusai and matan,

    Sorry I don’t like providing examples. It forces you guys to try and dig in it ;)


    Saturday, May 19, 2012 at 2:06 am #
  21. Thibault Imbert wrote:

    Hi drpelz,

    I would love to, but so far, no plans.


    Saturday, May 19, 2012 at 2:07 am #
  22. J’ai posté un message sur la page Errata du site web de O’Reilly pour signaler une erreur de compilation N° 1067 à la page 9 à la ligne :
    addChild (new Stats());
    quand on effectue le test de cet exemple sous Flash Builder 4.6 (SDK Flex 4.6.0 avec Starling 1.2 et la classe version “V0.3″.

    Peut-être serait-ce bien d’expliquer (si ce n’est déjà fait) :
    - pourquoi cette erreur ou ce genre d’erreur peut arriver,
    - comment faire pour les éviter et éviter les confusions et les incompatibilités entre les classes de flash et celles de starling sur DisplayObject,
    - comment faire si c’est possible pour utiliser les deux dans une même application sans problème ? (sauf si déjà expliqué ?)
    Et dans la foulée :
    - pourquoi ne pas avoir choisi de donner aux nouvelles classes de starling des noms différents des classes de flash ? surtout si on admet qu’on ne peut pas passer de la dispaly list classique de flash à la dispalylist GPU de starling sur le Stage 3D sans une révision et une adaptation de son code.
    Désolé pour le Français mais je craignais d’être moins clair en anglais.

    Sunday, November 18, 2012 at 5:52 pm #
  23. Thibault Imbert wrote:

    Merci Hugues, j’ai recu ce matin ton errata, merci! Pas de soucis pour le Francais ;)

    Pour info, le book va etre mis a jour dans quelques jours, j’ai fais pas mal de changements et le souci dont tu parles est supprime car je n’utilise plus cette classe (qui en effet devrait etre indiquee ou la telecharger), je m’appuie desormais sur le stats counter de Starling qui est built-in (Starling.showStats = true).

    Pour ce qui est du nommage des classes, ce fut un long debat aborde sur le forum de Starling et Daniel a finalement decide de laisser ces noms. Je suis d’accord qu’au debut cela peut etre troublant mais la plupart des developpeurs s’habituent et finalement ne reparlent plus de cette decision.

    Pour ce qui est des details sur l’utilisation des deux dans une meme application, en effet je n’en parle pas, bonne idee!


    Monday, November 19, 2012 at 3:19 am #
  24. Bruce wrote:

    Bonjour Thibault, y a t’il un moyen de récupérer la couleur du pixel sur un TouchEvent?
    Merci pour ton livre (avec quelques fautes à corriger ;-) )

    Wednesday, November 28, 2012 at 9:18 am #
  25. Bruce wrote:

    Thibault, tu peux enlever mon commentaire, je gère les bitmapData avant de créer la texture, puis j’utilise Bitmap.getPixel

    Wednesday, November 28, 2012 at 10:05 pm #

Trackbacks/Pingbacks (2)

  1. [...] the "Starling" book from O'Reilly, via [...]

  2. [...] For learning Starling Framework I put knowledge into practice and developed shiny vegetarian Happy Snake game. I thank to Hemanth Sharma for his great tutorials Starting with Starling and also to Thibault Imbert for his very good book Introducing Starling. [...]