Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to darken the screen, and make a small "menu"(?)
Started by tima.xxxyyy Aug 24 2019 05:42 AM

- - - - -
2 replies to this topic
menu
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

tima.xxxyyy

[GLOBAL: userInfoPane.html]
tima.xxxyyy
  • Observer

  • 7 posts
  • Corona SDK

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.

Attached File  Forum_corona1.png   102.12KB   0 downloads



[TOPIC: post.html]
#2

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,861 posts
  • Corona SDK

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



[TOPIC: post.html]
#3

JoePringles

[GLOBAL: userInfoPane.html]
JoePringles
  • Contributor

  • 368 posts
  • Corona SDK

Yeah i usually do #1




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: menu