Sunday, February 1, 2009

Lua Alchemy Getting Sweeter in v02a

Thanks to Alexander Lua Alchemy now has sugar! What this means is you no longer need to make calls like the following in the Lua Alchemy code:
as3.call(myvar, "someCall", param1, param2)

Instead you can make calls that look like native Lua code:
myvar.someCall(param1, param2)

This includes chaining calls like a.b.c().d

Below is a preview of the release:

Note that the demo above requires Flash Player 10 (required by Alchemy and my use of the local file system to allow opening/saving files). It is also hosted here where it can take up a full browser screen and is much easier to read.

You will notice in the demo code a great number of calls to as3.tolua(xxx). These calls convert ActionScript types into Lua types where possible. We removed all automatic conversion from AS3 to Lua types for performance reasons - each time you cross the Lua<->C<->AS3 boundary you have to pay the Alchemy wrapper performance tax.

For more information on the upcoming release of v0.2a (official downloads available in the next few days) see:

4 comments:

  1. This is cool stuff. We've been looking at adding a programming language to the http://mygamebuilder.com site and this looks like a good way to do it

    ReplyDelete
  2. Hello, I want to add Lua Alchemy in my Flash application, but I don't know how to do. I've visited the code-google website, but I didn't find the documentation to use the library. Can you help me ? Thanks

    ReplyDelete