Skip to content

Simple and extensible overlay system using ImGui and the Kengine.

Notifications You must be signed in to change notification settings

phisko/koverlay

Repository files navigation

packages

Simple and extensible overlay system using ImGui and the Kengine.

ImGui windows are rendered as "always-on-top" windows over other Windows applications.

koverlay

System tray icon

Right-clicking on the system tray icon lets you start/stop various tools.

Keyboard shortcut

Alt + Q: enable/disable the overlay

Creating tools

Tools can be created in three different ways: lua scripts, C++ plugins, and kengine Systems (which are also loaded as plugins).

Lua scripts

Scripts can be added to the scripts directory, next to the executable, and will be automatically loaded.

Lua scripts use the ImGui lua bindings.

Scripts should define a global TOOL_NAME variable. This will be used by the overlay to provide an entry for the tool in the top-screen menubar, as well as system tray icon's context menu.

Scripts should also set a global TOOL_ENABLED variable according to what imgui.Begin() returns as its second parameter, e.g.:

shouldDraw, TOOL_ENABLED = imgui.Begin("Example", TOOL_ENABLED)

A user-provided scale factor can be accessed through the IMGUI_SCALE global variable. This should be used to properly scale child windows and other elements.

Example

An example lua script can be found here.

C++ plugins

Plugins can be added to the plugins directory, next to the executable, and will be automatically loaded.

Plugins should link with the ImGui version provided in examples/newPlugin to ensure ABI compatibility (as the internal ImGui data structures may change between versions).

Plugins should include the framework.hpp file provided in examples/newPlugin. For those who care, this defines some trampoline functions which take care of getting the GImGui context from the main executable's address space and setting up a PLUGIN_ENABLED variable, used to identify the state of the tool for the system tray context menu and the top-screen menubar.

Plugins simply have to define a const char * getName() function and a void imguiFunction() function.

A user-provided scale factor can be accessed through the g_scale global variable. This should be used to properly scale child windows and other elements.

Example

An example plugin can be found here.

Kengine plugins

As the overlay uses the Kengine, it can load plugins which provide systems for the engine (which may do anything you want them to, and access each other's entities and components to share data between systems).

These plugins can be added to the plugins directory, next to the executable, and will be automatically loaded.

Plugins should link with the kengine version used to compile the overlay's main executable to ensure ABI compatibility (as the internal kengine data structures may change between versions).

Plugins simply have to define a void loadKenginePlugin(kengine::EntityManager & em) function that creates a kengine::Entity and attaches whatever behavior the plugin needs.

A user-provided scale factor can be accessed through the GetImGuiScale function component. This should be used to properly scale child windows and other elements.

Example

An example system can be found here.

About

Simple and extensible overlay system using ImGui and the Kengine.

Resources

Stars

Watchers

Forks

Packages

No packages published