What is the recommended way to create pause screen? (SOLVED)

Hello, I’m new to Defold. I’m trying to implement pause screen on my game.

The first easy approach I make is create an overlay node with button (as pause screen), then the script will trigger its position to cover the screen or out of the screen. The problem is I notice that we could still make an interaction with other node behind the bigger node (my pause overlay).

What is the recommended way to create pause screen?

Thanks.

Hi. If you return true from on_input for the duration you want the game to be paused, as long as your pause screen game object acquired input focus after everything else in the scene (it’s the top of the input stack), it will not let input events pass through it.

3 Likes

ahh, So I need to redo my pause screen. Currently my pause screen on the same scene as the gameplay, and controlled it from GUI script. I try to make it simple due to its only a quiz game.

Thanks for your reply, may be I’ll try to implement it as new screen.

This manual section actually covers exactly this, how to setup a pause-screen using acquire_input_focus

3 Likes

Thanks, this is what I’m looking for, finally I understand what @dapetcu21 means.
:grin: and sorry for not read the manual carefully.

1 Like