Skip to content

Namespace LuaAPI

Namespace List > LuaAPI

Registers the Engine 's C++ API into the shared Lua state.More...

Detailed Description

The API is split into focused registration modules.

Scripting/LuaAPI/Plugins/ — one file per Engine plugin, each owning the Lua functions for that plugin:

  • Position -> Transform (getPosition -> {x, y, z} / setPosition(x, y [, z]) / translate / getZIndex / setZIndex)
  • Rotation -> Transform (getRotation / setRotation / rotate)
  • Sprite -> Component.addSprite / getSprite
  • Shape -> Component.addShape
  • Text -> Component.addText
  • Collider -> Component.addBoxCollider
  • Controller-> Controller.isActionActive / getActiveActions / addKeybind / hasController, Controller.KEYBOARD.*
  • Opacity -> Component.setOpacity / getOpacity
  • Parent -> Component.setParent / getParent / getChildren
  • Input -> Input.isKey*, Input.getMousePosition, KEY.*
  • Multiplayer -> Net.register / on / off / send / broadcast / onConnect / onDisconnect / isServer / localId

Scripting/LuaAPI/ — core modules that are not plugins:

  • Log -> log, print
  • Time -> Time
  • Entity -> Entity
  • ComponentQuery -> Component.has / remove (cross-component)
  • Scene -> Scene (placeholder)

Each module exposes a single register* function taking a sol::state_view (by value) and, when registry access is needed, the Registry. Shared utilities live in LuaAPI/Internal/Helpers.hpp.


The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Scripting/LuaAPI.hpp