Entity's Lua UserData
Alacrity exposes the Entity struct as a Lua UserData object that is accessible from any Rust module that imports and instantiate the Alacrity data structure to create a new alacrity Lua context (i.e):
import alacrity-lib::prelude::*; fn main() -> Result<(), Box<dyn std::error::Error>> { let alacrity = Alacrity::new(None)?; let lua_data = r#" local entity = alacrity.Entity.new({ ... }) "#, alacrity.load(lua_data).exec() }
Please, refer to the LUA Tables programmatically entity creation section of the documentation to learn how to create new entities in Lua contexts.