Hello,
I need to create an additional window to my game (if possible a classic win32 window), which would be able to exchange datas with actors.
I need to have some controls (button, edit etc.) in it and to achieve some drawing staff with HDC functions.
I found a way but a ugly one :
a plugin which create a win32 window with a “button”
some changes into engine source code (Launch.cpp and LaunchEngineLoop.cpp) in order to get pointers toward actors instances.
And when I click on the button of the additional window, the speed of an actor is changed.
Is there a prettier way to achieve that ?
I’m currently trying to put my “CreateWindowEx” code into a “false” actor but no success so far.
No better result with my research about FWindowsWindow class.
Why would you go with native win32 window when you can create an SWindow and have all of the Slate benefits (styling and input processing)? Slate windows are actually native windows, they just look prettier and are easier to control from the engine.
In fact, there is not much examples about SWindow. I thought it was for additionnal windows INSIDE the UE4 game window.
I need a real additionnal window, outside the game window, to be used with multiples screens.
Is it possible with SWindow ? Any example code about how and where to create it ?
from here you should be able to get it running if you’re at least somewhat familiar with Slate. Please keep in mind that you will have to clean the window up (destroy it) manually on game end. This part can be a bit tricky ; )
As for where to keep you window, you can either create a singleton class, something like “MyWindowManager”, that will take care of bringing the window up and destroying it, or you can just keep it in player’s HUD, initialize it in BeginPlay event or something.
Take a look at STestSuite.cpp file for examples of Slate windows and widgets in general.
Is a little late for you, but for future ones maybe will help.
I remember I had same problem 3 years ago. I asked every where about some help how to achieve that with Widget Blueprint as feed to window content and now want helped me, also told me it can not be done… But I remember I worked one week to understand the UE API and I reused they window creation logic on C++ level and convert it to blueprint plugin.
Sow the only way to achieve working with all UE package supports is true UE API.
And worked… almost. I do not have the code unfortunately, but I have sum images as a memory flashback. In the code Image was captured the part where you can take and blueprint widget and set it as new window content.