Overlays
Want the powerful flexibility of ImGui for a simple text overlay? Here’s how.
First make sure you’ve uncommented all of the plugin window code in the template’s .h file. Then in your GUI file go to the render() function. For a custom overlay, you’ll need to prepare flags for it to appear the way you want it to.
These are found at line 744 of imgui.h
Some useful flags for an overlay are:
ImGuiWindowFlags_NoTitleBar
removes the title bar
ImGuiWindowFlags_NoScrollbar
disables a scroll bar from appearing
ImGuiWindowFlags_AlwaysAutoResize
automatically resizes the window to fit the content
ImGuiWindowFlags_NoDecoration
removes the scrollbar, title bar, and disables manual resizing
ImGuiWindowFlags_NoFocusOnAppearing
prevents the overlay from stealing focus from other ImGui windows
ImGuiWindowFlags_NoInputs
makes the mouse pass right through the window to RL
ImGuiWindowFlags_NoBackground
disables the background of the window
Here’s an example of starting a window with some flags
|
|
If you don’t want the overlay to close when a user presses esc, change this function to return false
|
|