READ BEFORE USE
Program Window Display is a mod that lets you display windows in the game. It contains two parts and two commands.
I wanted to make a mod that feeds data to external programs, and use them to draw UI and cockpit objects. However, I failed and didn't want to continue, so this is the half I managed to make. You can still use it to watch VTuber livestreams during long flights, I guess.
! WINDOWS ONLY !
This mod uses
user32.dll and Unity built-in
System.Drawing.dll. There is no platform check, and what happens on Mac is untested.
"My window is white!"
- Check that the window is open. Open them before entering the level, or you will have to restart.
- Check that the class name and window title are spelt correctly and are an exact match to the window information. If you can get away with leaving one empty (usually the window title), do it.
- Check for
IndexOutOfRangeException. Increase the size.
"My window is black!"
- If possible, turn off hardware acceleration for the application.
- If not possible, you cannot display that window.
- It CANNOT control other applications from the game
- It CANNOT perform remote internet access
- The mod can cause sensitive information to be captured during screen recordings, or written to the log files.
- Windows drawn directly to the hardware (e.g. pretty much every game) cannot be shown. (Read up by searching "printwindow black screen")
- Turn off hardware accelerated graphics on windows you want to show, including Chromium-based browsers.
The mod adds the parts "Program Window" and "Unlit Program Window", which use standard and unlit (always illuminated) shaders respectively.
- Class Name, Window Title: Used to find the correct window. Must be a perfect match to the window data. Use the provided commands to find it. Further reading
- Max Size: The size of the texture. It must be a power of two and should be larger than the window you want to capture. If you get
IndexOutOfRangeException, increase the size.
- Update Period: The rate of capture of window contents, in the number of frames.
- Filter Mode: Choose the amount of smoothing applied to the texture.
- Opacity: Global opacity to render a window with.
- Transparency Options: When enabled, colors in the window that are close enough to the defined color will be transparent. A threshold of zero means that only exact matches are turned transparent.
- Display Rect Options: When enabled, pixels outside of the defined coordinates will be transparent. It can be used to hide unwanted contents.
Notice: Due to device differences, you may need to adjust the display rectangle.
The display rectangle lines up with the video in normal mode.
Window Title: (null)
Writes information of all available windows. Click on each entry in the dev console to view the window title, class name, and pointer of the window.
Writes information of all windows which have the entered string in the title. For example,
ListWindowsWithName SimplePlanes will show all windows that contain "SimplePlanes" in the title.
(i.e. some code copied from the following webpages)