Topics |
The require function is the main mechanism for Lua to include new packages into source code. Invoking require will cause Lua to search a number of predesignated paths on the filesystem for the package. These paths can also be modified at runtime.
XLua extends require by also searching special areas in MMF. The first of these areas is the Binary Data section of the Data Elements editor. This is a place that a script file or C module could be stored, and when the application is built, those files would be embedded in the EXE, hidden away.
The second area XLua looks is in the embedded scripts list in the XLua object itself, so it is possible to 'require' any embedded script directly by name.
Copyright 2010 Justin Aquadro