Skip to content

amuTBKT/ImGuiPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

202 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImGuiPlugin

A simple plugin for integrating Dear ImGui in Unreal Engine 5.

Installation

  • Clone the repo in Project/Plugins folder git clone git@github.com:amuTBKT/ImGuiPlugin.git
    or download zip and extract under Project/Plugins folder.
  • Include the plugin in your own modules.
  • Feel free to use ImGuiExamples as reference.

Static Lib

For editor builds the plugin also supports linking ImGui as a static library. This can improve performance when widgets make signficant amount of ImGui calls.
Calling Source/Thirdparty/ImGui/Build.bat from MSVC command prompt (x64 Native Tools Command Prompt) should generate the required libs under "/ImGuiPlugin/Source/Thirdparty/ImGui/Binaries" directory.
Make sure to regenerate project files or touch Source/Thirdparty/ImGui/ImGui.Build.cs in order to update the library dependency.

Usage

At it's core the plugin is just a Slate widget with ImGui renderer, yes it's that simple :)
The plugin manages a global widget/window which can be used to add global widgets (managers, stats visualizer etc.)
User can also create SImGuiWidget widget which works like any other Slate widget with an addition of Tick delegate which can be used to add ImGui widgets.

Adding widgets to main window

  • Using IMGUI_REGISTER_MAIN_WINDOW_WIDGET(RegisterParams)
  • Dynamically binding to main window delegate
    UImGuiSubsystem* Subsystem = UImGuiSubsystem::Get();
    MainWindowTickHandle = Subsystem->GetMainWindowTickDelegate().Add(TickDelegate);`
    

Creating a standalone widget

  • Using IMGUI_REGISTER_STANDALONE_WIDGET, works in editor only. In packaged builds all widgets are added to the main ImGui window.
  • Creating a standalone ImGui widget
    UImGuiSubsystem* Subsystem = UImGuiSubsystem::Get();
    ImGuiWindow = Subsystem->CreateWidget("WidgetName", /*WindowSize=*/{ 300., 300. }, TickDelegate);
    

Creating a slate widget

Users can create SImGuiWidget widget and add them to viewport or Slate containers, works similar to any other slate widget.

About

ImGui plugin for unreal engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors