Scripted Editor Windows
Scripts can expose ImGui-powered editor tabs by exporting special functions.
Required Exports
RenderEditorWindow(ScriptContext& ctx)— Called every frame while tab is openExitRenderEditorWindow(ScriptContext& ctx)— Called once when tab closes
Example
Scripts/CustomWindow.cpp CPP
1
400">class="text-violet-400">#include "ScriptRuntime.h"
2
400">class="text-violet-400">#include "ThirdParty/imgui/imgui.h"
3
4
400">extern "C" 400">void RenderEditorWindow(400">ScriptContext& ctx) {
5
400">ImGui::TextUnformatted("Hello from script!");
6
400">if (400">ImGui::Button("Log")) {
7
ctx.AddConsoleMessage("Editor window clicked");
8
}
9
}
10
11
400">extern "C" 400">void ExitRenderEditorWindow(400">ScriptContext& ctx) {
12
(400">void)ctx;
13
}
How to Open
- Compile the script so the binary is updated under
Cache/ScriptBin/. - In the main menu, go to View → Scripted Windows and toggle the entry.
Note: Both RenderEditorWindow and ExitRenderEditorWindow must be exported with extern "C" (they are not wrapper-generated).