OMIDIV
ImGuiManager Class Reference

Performs OMIDIV-specific ImGui operations, such as setup, base UI drawing, and events. More...

Inheritance diagram for ImGuiManager:

Static Public Member Functions

static void AddMainMenuTab (string name)
 Adds a tab to the main menu bar if it doesn't already exist.
 
static void RemoveMainMenuTab (string name)
 Removes a tab from the main menu bar.
 

Properties

static bool IsEnabled = true [get, set]
 Whether the GUI is enabled.
 
static bool IsDebugEnabled [get, set]
 Whether debug stuff should be drawn.
 

Events

static Action Draw
 Called when the UI is drawn. Modify the UI by subscribing to this event.
 
static Action< string > DrawMainMenuItems
 Called with the name of the tab for each main menu tab.

 

Detailed Description

Performs OMIDIV-specific ImGui operations, such as setup, base UI drawing, and events.

Member Function Documentation

◆ AddMainMenuTab()

static void ImGuiManager.AddMainMenuTab ( string name)
static

Adds a tab to the main menu bar if it doesn't already exist.

Parameters
nameThe tab title.

It is recommended to call this in OnEnable, and RemoveMainMenuTab(string) in OnDisable.

◆ RemoveMainMenuTab()

static void ImGuiManager.RemoveMainMenuTab ( string name)
static

Removes a tab from the main menu bar.

Parameters
nameThe tab title to remove.

Not removing a tab could result in the tab remaining in subsequent scenes.

Property Documentation

◆ IsEnabled

bool ImGuiManager.IsEnabled = true
staticgetset

Whether the GUI is enabled.

Draw will not be called if not enabled.

Event Documentation

◆ Draw

Action ImGuiManager.Draw
static

Called when the UI is drawn. Modify the UI by subscribing to this event.

OmidivComponent.DrawGUI is subscribed to this event.

◆ DrawMainMenuItems

Action<string> ImGuiManager.DrawMainMenuItems
static

Called with the name of the tab for each main menu tab.

The current version of ImGui doesn't support calling BeginMainMenuBar multiple time to append, instead just overwriting. Additionally, it doesn't support appending with BeginMenu with the same name (at least not in the current version).

void MyDrawMenuItems(string menuName) {
switch (menuName) {
case "File":
if (ImGui.MenuItem("Quit")) Application.Quit(); break;
...
}
}
See also
AddMainMenuTab(string)

The documentation for this class was generated from the following file: