StarlingCodea - The flash displaylist in Codea

When I bought Codea at the end of april my idea was to use it just for fast prototyping. But I was lucky, I discovered Codea in a good moment, because a lot of interesting features was just added (like meshes, box2d,exc), because the runtime was just released as open source, because a great game (yes, cargo-bot. thanks @ruilov, for the game that is amazing and for having, through this game, pushed me to buy Codea!) was just released, because a lot of passionate people was posting on this forum sharing ideas, code, ecc.

So I started to think that Codea could be used for full development, not just prototyping, to integrate or maybe substitute the work I was doing on PC.

On PC I was working with flex (air support for mobile is just amazing!) using a 2D open source framework called Starling, that offers a displayList very similar to the classic flash displayList, but based on Stage3D. Starling was the port back to as3 of the Objective-C Sparrow framework for iOs, created by the same company, Gamua (http://gamua.com/)

Then I decided to find a way to share the data files and possibly the code logic (having so an easy way to translate game code from lua to as3), and the result is a (not full) porting of Starling in lua for Codea: https://github.com/Shrike78/StarlingCodea

The project shares a lot of things with the original framework, first of all the use of quads (meshes) and texture atlas to optimize bitmap rendering, but at the end a lot of things are different too, sometimes simplified (like events management), sometimes extended (like Tween support, that takes ispiration from Starling tween implementation but also from @John TweenLibrary and other lua and as3 tween libraries). Some other things are just missing right now (like BmpFont support), but will be added in a future.

The project is still not finished but the most important things are ready and usable, and so I’ve cleaned up the code, created a basic example and shared it with anyone can be interested in. The example doesn’t cover all the feature of StarlingCodea, but I hope it could give a good idea of what can be done with this framework.

The development of the library is in progress, and goes in parallel to the needs I have for specific features in the projects I carry on.

Feedbacks, bug reports and support are welcome :slight_smile:

NB
The framework was developed using @ruilov luaSandbox.lua file that provides recursive lib import and generic file read/write.
It can be used also with a standard luaSandbox but with limitation, and anyway requires a bit of work to make the example run.

That’s a crap ton of files there, but cool

I’ve updated the code on GitHub with some fixes and improvements that increase quad draw performances under specific situation.

Codea true type font textfields are now supported as specific DisplayObj and Button class has been extended with textfield integration.