Expand description
Gizmo Scripting — a Lua-based game-logic scripting layer for the Gizmo engine.
Scripts run inside a sandboxed mlua Lua 5.4 VM. Because Lua callbacks
cannot borrow and mutate the ECS World directly, they enqueue changes as
ScriptCommands into a CommandQueue; the ScriptEngine later drains
and applies those commands at a controlled point in the frame.
§Usage
ⓘ
let mut script_engine = ScriptEngine::new().unwrap();
script_engine.load_script("scripts/player.lua").unwrap();
// Each frame:
script_engine.update(&world, &input, dt).unwrap();
script_engine.flush_commands(&mut world);§Lua API surface
entity— read/write position, rotation, scale, velocity; spawn/destroyinput— query key and mouse statephysics— apply forces and impulsesscene— save/load scenes, look up entitiesaudio— play 2D/3D soundstime— delta time, elapsed time, FPS
Re-exports§
pub use commands::CommandQueue;pub use commands::ScriptCommand;pub use engine::Script;pub use engine::ScriptContext;pub use engine::ScriptEngine;pub use engine::ScriptResult;
Modules§
- api_ai
- AI API — Lua’ya sunulan Yapay Zeka navigasyon fonksiyonları
- api_
audio - Audio API — Lua’ya sunulan ses yönetim fonksiyonları
- api_
entity - Entity API — Lua’ya sunulan entity yönetim fonksiyonları
- api_
fighter - Fighter API — Lua’ya sunulan dövüş sistemi fonksiyonları
- api_
input - Input API — Lua’ya sunulan girdi sorgulama fonksiyonları
- api_
physics - Physics API — Lua’ya sunulan fizik sistemi fonksiyonları
- api_
scene - Scene API — Lua’ya sunulan sahne ve oyun yönetim fonksiyonları
- api_
time - Time API — Lua’ya sunulan zaman fonksiyonları
- api_
vehicle - Vehicle API — Lua’ya sunulan araç kontrol fonksiyonları
- commands
- Script Command Queue — Lua scriptlerden gelen değişiklik isteklerinin biriktirildiği kuyruk
- engine
Functions§
- register_
script_ components - Registers the scripting layer’s serializable scene components (currently
Script) into a sceneComponentRegistry.