How to darken the screen, and make a small "menu"(?)

Did you play simple mobile games? ( ‘rider’ ?). If you did, you now, how working button ‘pause’ : skrin with game content darken, and appears button ( ‘continue’ , ‘menu’ ). how can i do this? And if you didn’t understand me, watch a picture.

There’s a few ways:

  1. Create a display group that contains a black rectangle the size of the screen with an alpha of say 0.5. Add the buttons on top. Only show or even create this display group when needed. Either put a touch listener on the black rect to prevent touches on objects below, or use some flag to ignore interaction with those objects when in ‘pause’ mode.

  2. Use a composer scene that consists of the same as above and display using composer.showOverlay. You can use isModal = true to stop touches on objects in the scene underneath.

https://docs.coronalabs.com/api/library/composer/showOverlay.html

Yeah i usually do #1

There’s a few ways:

  1. Create a display group that contains a black rectangle the size of the screen with an alpha of say 0.5. Add the buttons on top. Only show or even create this display group when needed. Either put a touch listener on the black rect to prevent touches on objects below, or use some flag to ignore interaction with those objects when in ‘pause’ mode.

  2. Use a composer scene that consists of the same as above and display using composer.showOverlay. You can use isModal = true to stop touches on objects in the scene underneath.

https://docs.coronalabs.com/api/library/composer/showOverlay.html

Yeah i usually do #1