This is the development repo of Moai SDK. Current, but not necessarily tested or stable.
C++ Java Lua Objective-C++ CMake Shell Other
Latest commit 407a20b Jun 6, 2016 @ConghuZhao ConghuZhao Version Increment
Failed to load latest commit information.
3rdparty-android Merge branch 'feature/android-studio' into develop-casinowonders Jul 27, 2015
3rdparty removed spine; added fixes for batching indexed prims Oct 19, 2015
ant added web support to android; fixed android build Oct 24, 2015
bin get expat going for emscripten again Nov 28, 2015
cmake get expat going for emscripten again Nov 28, 2015
docs pito lives! Oct 21, 2015
host-templates Sample Browser Implementation Nov 28, 2015
hosts Fixed ignore Mar 17, 2015
lib Fixed ignore Mar 17, 2015
samples-legacy added method to get info about a virtual file system path and file co… Aug 8, 2015
samples Modify example for prop tracking to be clearer Jun 3, 2016
src Add capability to track a transform's position with MOAICameraFitter2D. May 29, 2016
test fixed merge conflicts; updates xcode projects (ios and osx) Apr 24, 2015
util Version Increment Jun 6, 2016
vs2008 restored IDE projects Jun 2, 2014
vs2010 restored IDE projects Jun 2, 2014
xcode splitting up iOS build scripts for better job distribution across the… Oct 27, 2015
.gitattributes set gitattributes to correctly identify text files Jun 14, 2012
.gitignore Sample Browser Implementation Nov 28, 2015
.gitmodules added civetweb as a submodule; upgraded jansson to 2.7 Sep 13, 2015
.travis.yml undoing travis changes Oct 13, 2015 Add clause about merging master into development Aug 25, 2013 collect notes about tool dependencies Oct 20, 2015
appveyor.yml try to speed up build by skipping cmake install and debug build Apr 2, 2015
circle.yml circle ci warning about bad project was too loud. revert Apr 12, 2015
version.txt Organize files Feb 23, 2014

Welcome to Moai!

Thanks for checking out the Moai source code. Here's the scoop.

Linux CI: Build Status OSX CI: Build Status


Moai SDK is an open source game framework for quickly developing great mobile games.

You can work in Lua or C++, and Moai SDK runs on multiple platforms including iOS, Android, Chrome, Windows, Mac and Linux.


Please clone the source in the following way.

git clone
cd moai-dev
git submodule init
git submodule update


Tools needed to build the MOAI SDK.

The following tools are required to build the API documentation.

On Mac OSX some tools need to be installed with homebrew:

$ brew install xctool ios-sim cmake

cmake needs to be 3.3 on osx

On Mac OSX, Linux and Windows, Android studio version should be 1.4+ and Android ndk can be r10e+

Please set the following environment variables.


export MOAI_BIN=<install_path>/moai-dev/release/osx/host-sdl/bin
export MOAI_CONFIG=<install_path>/moai-dev/samples/config


export MOAI_BIN=<install_path>/moai-dev/release/linux/host-sdl/x64/bin
export MOAI_CONFIG=<install_path>/moai-dev/samples/config


set MOAI_BIN=<install_path>\moai-dev\release\win32\host-sdl\bin
set MOAI_CONFIG=<install_path>\moai-dev\samples\config

Build Hosts

Please build according to the following procedure.

Windows Host

cd moai-dev

OSX Host

# Build
cd moai-dev

# Run
cd <sample_directory>
$MOAI_BIN/moai main.lua

iOS Host

cd moai-dev
./bin/ <lua_dir>

Linux Host

# Build
cd moai-dev

# Run
$MOAI_BIN/moai main.lua

Android Host

# Build
export ANDROID_NDK=<path_to_android_ndk>
cd moai-dev

# Edit Setting
cd release/android/host

# Run


export EMSCRIPTEN_HOME=<path_to_emscripten_1.7.1>
cd moai-dev

<http-serve> cmake/build/host-template/www

#see src\host-html\ for more info

Create IDE Projects

Visual Studio

Execute create-projects-win.bat in moai-dev\bin. By default, this creates a Visual Studio 2012 solution in moai-dev\cmake\projects\vs2012. To generate project files for a different version of Visual Studio, specify your desired version (vs2008, vs2010, vs2012, or vs2013) as a command-line argument.


open cmake/projects/moai-ios/moai.xcproj


open cmake/projects/moai-osx/moai.xcproj

Sample code

Go to the samples folder, which contains dozens of samples that can be run using one the hosts located in ant (Android), xcode (OSX and iOS), or Visual Studio (Windows).

One of our priorities is to build richer samples for Moai developers, so if you'd like to see a particular code sample, let us know by posting in the Moai forums.


This SDK uses the CPAL license. Refer to the for attribution screens to include with games made with Moai.



Moai Pages