Exciting news for the Umajin engine. We can now include run time scripting with support for many languages. Here is an example using Lua.

factorial

Here is a factorial function in Lua which is added to the MyScript object using dostring. Then it can be called from Umajin by name and parameters passes in.

bee2

This example shows bidirectional calling. First we create a script object and add our Lua code. This has a move_bee function which will in turn call a method on a Umajin object called animate which takes an object an x, y position.

Then we create a bee object from the image class. This object has an animate method which takes an x, y position as parameters.

Finally when the mouse_down event is raised we execute the move_bee function in the Lua code, passing the bee object and x,y parameters. The Lua code executes calling the Umajin animate method on the bee object triggering the animation!!