Class JseBaseLib

All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable, ResourceFinder

public final class JseBaseLib extends BaseLib
Subclass of BaseLib and LibFunction which implements the lua basic library functions and provides a directory based ResourceFinder as the Globals.finder.

Since JME has no file system by default, BaseLib implements ResourceFinder using Class.getResource(String). first, then falling back to Class.getResource(String) if that fails. Otherwise, the behavior is the same as that of BaseLib.

Typically, this library is included as part of a call to

 
 Globals globals = JsePlatform.standardGlobals();
 globals.get("print").call(LuaValue.valueOf("hello, world"));
  

For special cases where the smallest possible footprint is desired, a minimal set of libraries could be loaded directly via LuaValue.load(LuaValue) using code such as:

 
 Globals globals = new Globals();
 globals.load(new JseBaseLib());
 globals.get("print").call(LuaValue.valueOf("hello, world"));
  

However, other libraries such as PackageLib are not loaded in this case.

This is a direct port of the corresponding library in C.

See Also: