https://github.com/cstom4994/imgui_lua_inspector
imgui lua runtime inspector and console
https://github.com/cstom4994/imgui_lua_inspector
gamedev imgui lua runtime
Last synced: 7 months ago
JSON representation
imgui lua runtime inspector and console
- Host: GitHub
- URL: https://github.com/cstom4994/imgui_lua_inspector
- Owner: cstom4994
- Created: 2024-04-13T12:51:27.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-09T06:26:00.000Z (almost 2 years ago)
- Last Synced: 2025-02-12T16:55:20.153Z (about 1 year ago)
- Topics: gamedev, imgui, lua, runtime
- Language: C++
- Homepage:
- Size: 8.37 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ImGui Lua Inspector
ImGui tool for inspecting and modifying the Lua registry's value in real time which can embed in your game engine easily
[imgui_lua_inspector](https://github.com/cstom4994/imgui_lua_inspector)
## Usage
```cpp
// Just register luainspector functions to lua
lua_register(L, "__neko_luainspector_init", neko::luainspector::luainspector_init);
lua_register(L, "__neko_luainspector_draw", neko::luainspector::luainspector_draw);
lua_register(L, "__neko_luainspector_get", neko::luainspector::luainspector_get);
/*
__neko_luainspector_init should be called when your game is initialized, it will return a luainspector userdata
__neko_luainspector_draw should be called every frame (before ImGui::Render()), it needs to be called with a luainspector userdata
__neko_luainspector_get is used to get the userdata of the only luainspector that exists in the lua registry
*/
```
```lua
function game_init()
inspector = __neko_luainspector_init()
end
function game_render()
__neko_luainspector_draw(inspector)
-- or __neko_luainspector_draw(__neko_luainspector_get())
-- ...
-- ImGui::Render() called
end
```
## Demo
