I just wanted to tell you that I just pushed the current development state of Starling 2.0 to GitHub. It's on a separate "v2.0" branch right now:
You can also have a look at the API reference, for a high level overview about the new classes. (I tried my best to add a lot of documentation right away during development.)
For those who haven't seen it yet, here's a demo of what becomes possible with this new version:
In that demo, make sure to note the draw count! Yes, all that custom rendering code is batched.
Before you look any further, beware that you should NOT upgrade any of your games right now. First of all, this version is unfinished (e.g. filters are completely deactivated right now); second, a lot of classes and method names have changed, so updating an existing game is a little more effort than usual.
That said: most of the changes compared to version 1.x are internal, or don't need to bother you as long as you're not writing your own rendering code.
Here's a very rough overview about the most important changes; a more detailed post will follow.
- New "Mesh" class, from which "Quad" and "Image" now inherit, describing an arbitrary geometry.
- "MeshStyles" can teach Starling new tricks. The dynamic lighting from above is such a style. You can assign it to any mesh.
- Internally, those styles use the new "MeshEffect" class (i.e. subclasses) to manage their AGAL code and render logic.
- Starling now auto-detects if parts of the display tree are changing, and optimizes rendering automatically for those areas. That's going to be amazing for Feathers apps: static screens won't take up much CPU any more.
- A new "Painter" class replaces the "RenderSupport" class. It contains a stack of ...
- "RenderStates" that encapsulate all context settings.
- The TextField class is now accompanied by a "TextFormat", just like in classic Flash (but easier to use).
- And, yes, I finally added a "wordWrap" property to the TextField.
- Repeat the last one, and read it out loud. Finally, PixelSnapping! Works for all meshes automatically.
- The "VertexData" class is now much more flexible and can use arbitrary "VertexFormats".
- It's also accompanied by the new "IndexData" class.
- Both use ByteArrays internally, of course.
- You can now attach "frame actions" to MovieClips -- i.e. code to execute at certain frames.
That's just a small fraction of all that's been done in the last 6 months. Yes, I've been busy! You'll find more than 100 commits since version 1.7. A lot of the changes are not visible to the outside, but are just clean-ups and preparations for future changes.
Nevertheless, Starling is still as small and lightweight as before. Version 1.7 has about 12k lines of code, version 2 is currently at 13.5k. Yes, many of your games will probably be much more extensive!
As mentioned above, I'm not finished yet, though. Here's what I want to add before making 2.0 final:
- Completely new Filter architecture. Right now, filters are deactivated.
- Scale3 & Scale9 support in Image class
- Tiling support in Image class (just like Feather's TiledImage)
- and some more small things.
As always, I'd be happy about any feedback. I know it's probably in a too early state for many of you, but those who are interested in Starling's internals are very welcome to take a look and tell me if you like what you see, or if there's anything that's not to their liking.
To anyone taking a look: have fun!
Cheers to the best community a framework could ever have!