Creating a Window
Create out of game windows with the following:
overlay.windows.createWindow(options);
This will return an electron BrowserWindow.
You must create every out of game window with this method so that Overlayed can keep track of them.
In-game Windows
To render a window in-game, you’ll need to do the following:
overlay.windows.createInGameWindow(options);
This will return a RenderWindow, read more about them in-depth
here.
If you want to render the same window in-game and out-of-game, you’ll need to create the window
twice, once with createInGameWindow and once with createWindow.
Active Game Info
The getActiveGameInfo method returns useful information like if the overlay is connected to the
game, the game’s resolution, etc.
overlay.windows.getActiveGameInfo();
Global Window Events
The windows object emits the following **global **events:
Resolution
Listen to when the game changes resolution.
overlay.windows.on("resolution", (width: number, height: number) => {
// ...
});
Key Down
overlay.windows.on("keyDown", (event: KeyboardKeyEvent) => {
// ...
});
Key Up
overlay.windows.on("keyUp", (event: KeyboardKeyEvent) => {
// ...
});
Keyboard Focus
overlay.windows.on("keyboardFocus", (focus: boolean) => {
// ...
});
Mouse Down
overlay.windows.on("mouseDown", (event: MouseButtonEvent) => {
// ...
});
Mouse Up
overlay.windows.on("mouseUp", (event: MouseButtonEvent) => {
// ...
});