zla/README.md
2026-07-27 09:26:28 +01:00

40 lines
632 B
Markdown

**Simple**
```zig
// --- ZLA ---
var zla: Zla = try .init();
defer zla.deinit();
// --- EXEC FILE ---
try zla.execFromFile(
void,
"src/scripts/basic.lua",
);
// --- CALL ---
try zla.call(void, "hello", .{"World"});
try zla.call(void, "hello", .{"..."});
```
**Call lua directly**
```zig
const val = try zla.exec(i64, "return 6 * 9");
```
**Call function from lua**
```zig
try zla.call(void, "hello", .{"World"});
```
**Call function from lua with return type**
```zig
const coords = try zla.call(
struct { f64, f64 },
"getCoords",
.{},
);
```
**Dependancies**
```bash
sudo pacman -Sy lua --needed
```