Render background inert while dialog is open

Hi all,

I’m writing custom dialogs for my app (like native.showAlert()).

I’ve got a problem that the touch listeners in the background (the ones that are assigned to display objects that are not a part of the dialog, but are a part of the scene on which the dialog is overlaid) remain active once the dialog is in place.

Any idea how to easily keep these touch listeners from being activated while the dialog is up?

I have tried placing an opaque rectangle between the dialog and the background components and this doesn’t seem to work.

Thanks. [import]uid: 204879 topic_id: 34260 reply_id: 334260[/import]

Are you using storyboard overlays? There is setting to make the modal.

If not, what I do is put an eventListener on the background graphic to absorb any touch events:

local function blockTouch(event)
return true
end

dialogBackground:addEventListener(“touch”, blockTouch)

then that should help.
[import]uid: 199310 topic_id: 34260 reply_id: 136239[/import]

I wasn’t using storyboard overlays, but now I am and they work great, completely solved my problem! Thanks! [import]uid: 204879 topic_id: 34260 reply_id: 136330[/import]

Are you using storyboard overlays? There is setting to make the modal.

If not, what I do is put an eventListener on the background graphic to absorb any touch events:

local function blockTouch(event)
return true
end

dialogBackground:addEventListener(“touch”, blockTouch)

then that should help.
[import]uid: 199310 topic_id: 34260 reply_id: 136239[/import]

I wasn’t using storyboard overlays, but now I am and they work great, completely solved my problem! Thanks! [import]uid: 204879 topic_id: 34260 reply_id: 136330[/import]