Skip to main content

Module api_registrar

Module api_registrar 

Source
Expand description

ScriptApiRegistrar trait — enables game-agnostic JS API registration.

The core engine registers generic APIs (showText, moveNpc, getFlag, warpTo, etc.) on the game global object. Game-specific APIs (giveMonster, startBattle, etc.) are registered by implementors of this trait via ScriptEngine::with_api().

DSL scene management APIs (showScene, hideScene, updateUI) are registered as core APIs during ScriptEngine::new().

Traits§

ScriptApiRegistrar
Trait for registering game-specific JavaScript APIs.

Functions§

register_hide_scene
Register the game.hideScene() JS API on the given engine.
register_show_scene
Register the game.showScene() JS API on the given engine.
register_update_ui
Register the game.updateUI() JS API on the given engine.