Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetComponentDelphiDemoFiremonkeyIOSOSXWindows

Free Lua Scripting Interpreter Library For Delphi XE7 Firemonkey On Android And IOS

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi XE7 Firemonkey Lua Scripting Library For Android And IOS | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSDeveloper Dennis D. Spreen has released an upgraded wrapper component for Lua 5.3 that allows you to run Lua scripts in Delphi XE7 Firemonkey. The wrapper which is called VerySimple.Lua uses the Lua static and dynamic libraries to enable the component on Android, IOS, Windows, and OSX. Between this component and paxCompiler you can now interpret Lua, Object Pascal, Basic, and Javascript on all four Firemonkey platforms at runtime. Blizzard uses Lua as the scripting language in World of Warcraft as one example of where people use Lua. There is some sample code for using the wrapper on the blog post itself. There is also more sample code for using VerySimple.Lua and interpreting Lua scripts in both FMX and VCL on Google Code and in the download. This Lua scripting interpreter component should also work with Appmethod. It is free and full source code is available. A dynamic library is used on Android, OSX, and Windows. A static library is used on IOS. I looked through the code and here is a snippet for how it loads the dynamic Lua library:

// check if Library exists
if not FileExists(LoadPath) then
raise ELuaLibraryNotFound.Create('Lua library "' + QuotedStr(LoadPath) + '" not found');

// try to load the library
LibraryHandle := LoadLibrary(PChar(LoadPath));
if LibraryHandle = 0 then
raise ELuaLibraryLoadError.Create('Failed to load Lua library "' + QuotedStr(LoadPath) + '"'
{$IF defined(POSIX)} + (String(dlerror)){$ENDIF});

lua_newstate := GetAddress('lua_newstate');
lua_close := GetAddress('lua_close');

Head over and download the full source code for the Lua scripting interpreter for Delphi XE7 Firemonkey on Android, IOS, OSX, and Windows.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging


Unleashing Creativity With Song Writer AI: A Deep Dive


How To Build Stable Diffusion Text To Image Prompts


FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

Sign up for our Newsletter and
stay informed


Leave a Reply