Somewhere I read that it is possible to make the whole screen blurry. A blurry background is a good base for a menu. The idea is to make a screenshot, and then apply a filter. Works for me well. Here is a simple code.
local Top_Menu_group
Top_Menu_group = display.newGroup()
function top_menu_button_click(event)
if event.phase == "ended" then
-- Capture the screen
local Screen_shot
Top_Menu_group:removeSelf()
Top_Menu_group = display.newGroup()
-- first phase
Screen_shot = display.captureScreen( false )
Screen_shot.x = display.contentCenterX
Screen_shot.y = display.contentCenterY
Screen_shot.fill.effect = "filter.grayscale"
local Screen_shot2 = display.captureScreen( false )
-- phase 2 (Possibly, there is a way how to apply TWO filters...)
Screen_shot2.fill.effect = "filter.blurGaussian"
Screen_shot2.fill.effect.horizontal.blurSize = 20
Screen_shot2.fill.effect.horizontal.sigma = 50
Screen_shot2.fill.effect.vertical.blurSize = 20
Screen_shot2.fill.effect.vertical.sigma = 50
Screen_shot2.x = display.contentCenterX
Screen_shot2.y = display.contentCenterY
Screen_shot:removeSelf()
Top_Menu_group:insert(Screen_shot2)
end
end
The result looks wonderful! Now on top of it I can draw a colorful menu.
But, there is just a small peculiarity, must be a bug. If at this stage I suspend and then resume the application. On a real device the Screen_shot2 object just disappears revealing the real background. But in the emulator everything is OK, the Screen_shot2 is still there.
The situation does not change if I avoid using a display-group. Also, I got no function to monitor suspend/resume events, so there is no code which works with the mentioned objects.
Build 2020.3601