Render the overlay in the game engine UI
Overview¶
The overlay UI engine rendering feature displays the overlay provided by the SDK on the screen using the game engine's UI system. This feature uses OSR (Off-Screen Rendering) screen data from Chromium Embedded Framework (CEF). Hive SDK passes this data to the game engine UI to display the overlay. This approach helps render the overlay reliably on the game screen in Windows environments. This feature is supported in Hive SDK Unity Windows and Hive SDK Unreal Windows.
How to use¶
- Set the
engineOsrRenderEnabledvalue totruein hive_config.xml. - If you changed the setting after Hive SDK was already installed, rebuild the game package that includes the SDK. If you do not rebuild the game, the changed setting will not be applied.
- After the build is complete, run the game. It behaves as follows:
- Hive SDK Unreal Windows: Automatically finds the current game world (Game World) and directly renders the Hive SDK UI screen overlay on top of the game screen.
- Hive SDK Unity Windows: Directly renders the Hive SDK UI screen overlay on top of the game screen.
Unreal Engine: render the overlay by specifying the world directly¶
Hive SDK Unreal Windows automatically detects the current game world by default and renders the SDK UI overlay.
However, if your Unreal Engine project uses multiple worlds or renders the overlay in a special environment, the SDK may not be able to automatically determine which world should display the overlay. In this environment, call the SetTargetWorld() method and pass the target world object directly.
- Return to automatic selection: Pass
nullptrto switch back to the default world automatic selection mode. - Handling level transitions: If the specified world is destroyed, the SDK automatically returns to the currently active world, so you do not need to call this method again each time the level changes.