Lua on the iPhone?

半城伤御伤魂 提交于 2019-11-28 16:15:35
Rob Napier

You'll need to compile the Lua .a for ARM, not Intel. If the Lua library uses autoconf, you can use my favorite iphone/autoconf builder: build_for_iphoneos. If it's not autoconf, then you can use that script to get an idea of how to attack it. Sometimes you can just build a Static Library Xcode project, dump all the files into it and hit build. If the build is simple enough, it'll do most of the work for you.

I know it doesn't matter for your use, but Lua-based tools are generally shippable on the app store. You just can't download arbitrary code at run time and interpret it.

probablyCorey

You might want to check out iPhone Wax. It is a lua/iPhone bridge that lets you write native iPhone apps in pure lua! Here is a pretty good tutorial about it.

If you want to write Lua code for iOS, then check out MOAI immediately: http://getmoai.com/

Its an absolutely enjoyable framework for developing games on iOS and Android, as well as Windows and OSX. Not only that, but it provides a pretty good idea of how to properly implement a Lua-VM based hosting environment for scripting in a cross-platform manner: from MOAI, you can learn a lot about this. I've done 4 titles with MOAI so far, and won't be stopping any time soon .. MOAI absolutely kicks ass!

Also check out LOAD81, which is a similar effort albeit with SDL as the target environment: http://github.com/antirez/load81

(I've contributed a little to the LOAD81 project, specifically giving it features of interest/value to the OpenPandora community. MOAI is more commercial, LOAD81 more hobbyist..)

For those trying to learn Lua and the different methods of integrating the Lua VM in a project for multiple platform targets, both MOAI and LOAD81 can provide a lot of great background and clues about the right way to proceed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!