spwork
When the game window loses focus, I plan to pause the game and suspend the background music. Is there an event that can let me know that the game window has lost focus?
When the game window loses focus, I plan to pause the game and suspend the background music. Is there an event that can let me know that the game window has lost focus?
GetSubsystem<Input>()->HasFocus()
should do the trick.
If your application runs full screen GetSubsystem<Engine>()->SetPauseMinimized(true);
should suffice, btw.
thank you ,i find InputFocus
event can slove my problem.
Ah, right, there’s even an event for that.