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 finds the current game world and renders the SDK UI screen overlay on top of the game screen. However, if your Unreal Engine project uses multiple worlds or renders the overlay in a separate environment rather than the normal game screen, the SDK may have difficulty automatically determining which world should render the overlay. If the target world where the overlay should be rendered changes, pass the new world to SetTargetWorld() and call it again as shown below.
```cpp #include "CefOverlayManager.h"
void AMyPlayerController::BeginPlay()
{
Super::BeginPlay();
UCefOverlayManager::Get()->SetTargetWorld(GetWorld());
}
```