\* *Plugin has been updated to compile and work with at least this version of the engine. Commits updating plugin to newer version of the engine are tagged with this version's number. If newer engine version doesn't require any change then it want be tagged, so there is a chance that plugin works with version newer than officially supported. As long as possible I will try to maintain backward compatibility when updating to newer engine version (but not necessarily when adding new features). Right now plugin should be at least backward compatible to engine version 4.15.*
In recent commits I changed default behaviour from software to hardware cursor *(commit f18e1f0b6862ebc319b38a908e82c37d513ab99d)* and moved ImGui draw events to be called during world tick start rather than post-tick *(commit 052ae0a201590b024291130317f7e3a096542bed)*. Those changes may have some usability implications and so the old behaviour can be restored by using `ImGui.DrawMouseCursor` and `ImGui.DebugDrawOnWorldTick` console variables. There are good reason for those changes, but if they cause any issues, please raise them in the forum.
When running Multi-PIE session, each world gets its own ImGui context to draw world specific data. When world update begins contexts are switched automatically, so using ImGui during objects update should be as easy as calling ImGui API functions.
For scenarios where automatic context switching above is not enough I'm planning to add mechanism allowing to explicitly select contexts. After that I plan to add example project, more usability features, better documentation and integration of Remote ImGui which enables using ImGui from a browser and to investigate possibility of opening ImGui for Blueprints.
To use this plug-in, you will need a C++ Unreal project.
Content of this repository needs to be placed in *Plugins* directory under project's root: */Plugins/ImGui*. After you compile and run you should notice that *ImGui* module is now available.
To use that in other modules you will need to declare it as a public or private dependency in those modules' Build.cs files:
- **ImGui.InputEnabled** - Enable or disable ImGui input mode. 0: disabled (default); 1: enabled, input is routed to ImGui and with a few exceptions is consumed. Note: this is going to be supported by a keyboard short-cut, but in the meantime ImGui input can be enabled/disabled using console.
- **ImGui.DrawMouseCursor** - Whether or not mouse cursor in input mode should be drawn by ImGui. 0: disabled, hardware cursor will be used (default); 1: enabled, ImGui will take care for drawing mouse cursor.
When input mode is enabled, it is possible to activate *Canvas Map Mode* (better name welcomed) by pressing and holding `Left Shift` + `Left Alt` keys. In this mode it is possible to drag ImGui canvas and change its scale. It can be helpful to temporarily reach areas of canvas that otherwise would be inaccessible and to change what part of the canvas should be visible in normal mode.
In canvas map mode:
- **Mouse Wheel** - to zoom in and out.
- **Right Mouse Button** - to drag ImGui canvas (not available at maximum zoom out).
- **Middle Mouse Button** - to drag frame that represents part of the ImGui canvas that is visible in normal mode (only available after zooming out). To start dragging mouse needs to be in the centre of that frame.
- It is still possible to use remaining keys and gestures to use ImGui, but primary goal is to select part of the canvas visible in normal mode.
- Releasing `Left Shift` and/or `Left Alt` key switches back to normal mode and automatically sets scale to 1.