Archive 17/01/2023.

A simple question

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?

Modanung

GetSubsystem<Input>()->HasFocus() should do the trick.

Modanung

If your application runs full screen GetSubsystem<Engine>()->SetPauseMinimized(true); should suffice, btw.

spwork

thank you ,i find InputFocus event can slove my problem.

Modanung

Ah, right, there’s even an event for that. :slight_smile: