The SE Launcher supports multiple approaches to creating user interfaces. Depending on your needs and the context in which the UI is displayed, you may choose from a variety of supported frameworks:
VRage Sandbox GUI (MyGuiScreenBase
)
The native game GUI system used by the base game for menus and dialogs.
EmptyKeys MVVM-XAML (MyGuiScreenMvvmBase
)
A more modern approach using MVVM and XAML, as used by some newer parts of the Space Engineers UI.
Windows Forms / WPF
Standard UI toolkits in the .NET ecosystem. These are generally used for external or child windows, since they cannot be rendered on the main game window.
These options are available and usable, but may require more complex setup and are outside the scope of this article.
The preferred UI system in SE Launcher is Dear ImGui, a powerful and immediate-mode GUI library.
It is used for all SE Launcher native UI and is tightly integrated into the plugin system, making it the best choice for creating custom plugin UIs.
This article focuses exclusively on using ImGui, as other frameworks are either documented elsewhere or can be studied via existing plugin implementations.
To create a UI with ImGui, define a class that implements the IRenderComponent
interface.
All ImGui rendering must be done inside the OnFrame()
method, which is called every frame when the renderer is active.
using CringePlugins.Abstractions;
using ImGuiNET;
namespace TestPlugin;
public class TestRenderComponent : IRenderComponent
{
public void OnFrame()
{
if (ImGui.Begin("Test Window"))
{
ImGui.Button("Test");
ImGui.End();
}
ImGui.ShowDemoWindow();
}
}
In this example:
ImGui.ShowDemoWindow()
displays an interactive reference window with a showcase of all ImGui features and controls.This is an excellent way to explore the capabilities of ImGui while developing your UI.
To make your ImGui UI render in-game, you must register the component using the RenderHandler
during plugin initialization:
public void Init(object gameInstance)
{
RenderHandler.Current.RegisterComponent(new TestRenderComponent());
}
Once registered, your OnFrame()
method will be called every frame, and your ImGui-based UI will be drawn automatically.
ImGui is a complex and versatile UI framework, and covering all of its features is beyond the scope of this article.
To learn more, you can:
Explore the ImGui Demo Window via ImGui.ShowDemoWindow()
Look at how the SE Launcher uses ImGui in its own UI components:
These examples demonstrate real-world usage patterns for building complex UI with ImGui in the launcher environment.