overlay params?

Does hideOverlay support passing parameters back to the calling scene? For instance, an overlay that pops up a few buttons, and the user presses one… would be nice to get that passed back.

If this is currently not possible, could you consider adding that in a future update? [import]uid: 114363 topic_id: 35078 reply_id: 335078[/import]

I second this. I was just going to write something and saw this post.
I have this in my overlay scene:

local function onSceneTouch(event )  
 local options = {   
 effect = "fade",   
 time = 500,   
 params = {   
 whatWasSentBack = "Added text to " .. theInputText  
 }  
 }  
 storyboard.hideOverlay(options)  
end  

Then in my calling scene I have this:

function scene:overlayEnded(event)  
 local params = event.params  
 -- print("Params is: " .. params.whatWasSentBack)  
 tInput = native.newTextField ( 105, 300, 130, 25 )  
 tInput.text = params.whatWasSentBack -- line 57  
 tInput:setTextColor(0)  
 tInput.size = 14  
end  

I thought this should have the passed text, but get nothing back and get this:
scene1.lua:57: attempt to index local ‘params’ (a nil value)

thanks for any help. [import]uid: 101604 topic_id: 35078 reply_id: 139473[/import]

Yes… I am finding that as well. So I guess you cannot pass params back to the calling scene from the overlay. CoronaLabs… please consider this. Overlays make a nice pop-up dialog. [import]uid: 114363 topic_id: 35078 reply_id: 139474[/import]

schizoid2k - I just checked the docs (http://docs.coronalabs.com/api/library/storyboard/hideOverlay.html) and there is no mention of returning options in the hideOverlay as there is with showOverlay. To be honest I didn’t read the hideOverlay before just assumed it would be like showOverlay.

Seems logical - I thought it was a good way to present things like buttons, pickerwheel, etc. Get the user input and pass the info back. I do it now with gotoScene. What methods are others using to pop up to get user input ?

Docs are like toilet paper - don’t need it till your in the pooh - then you REALLY need it. [import]uid: 101604 topic_id: 35078 reply_id: 139475[/import]

dbl clicked [import]uid: 101604 topic_id: 35078 reply_id: 139476[/import]

You *could* attach your own data to the storyboard object in your overlay, something like:

storyboard.myReturnedButton="button1"

…and then in the overlayEnded function in the calling module check the value

[code]
function scene:overlayEnded(event)
local group = self.view;
local overlay_name = event.sceneName;

print(storyboard.myReturnedButton);
end
[/code] [import]uid: 70847 topic_id: 35078 reply_id: 139479[/import]

@ingemar… that’s exactly what I am doing now. I create a return variable in the storyboard object.

Would be nice to have params returned though… seems like a cleaner approach. [import]uid: 114363 topic_id: 35078 reply_id: 139487[/import]

Agreed. Would be cleaner… [import]uid: 70847 topic_id: 35078 reply_id: 139490[/import]

I second this. I was just going to write something and saw this post.
I have this in my overlay scene:

local function onSceneTouch(event )  
 local options = {   
 effect = "fade",   
 time = 500,   
 params = {   
 whatWasSentBack = "Added text to " .. theInputText  
 }  
 }  
 storyboard.hideOverlay(options)  
end  

Then in my calling scene I have this:

function scene:overlayEnded(event)  
 local params = event.params  
 -- print("Params is: " .. params.whatWasSentBack)  
 tInput = native.newTextField ( 105, 300, 130, 25 )  
 tInput.text = params.whatWasSentBack -- line 57  
 tInput:setTextColor(0)  
 tInput.size = 14  
end  

I thought this should have the passed text, but get nothing back and get this:
scene1.lua:57: attempt to index local ‘params’ (a nil value)

thanks for any help. [import]uid: 101604 topic_id: 35078 reply_id: 139473[/import]

Yes… I am finding that as well. So I guess you cannot pass params back to the calling scene from the overlay. CoronaLabs… please consider this. Overlays make a nice pop-up dialog. [import]uid: 114363 topic_id: 35078 reply_id: 139474[/import]

schizoid2k - I just checked the docs (http://docs.coronalabs.com/api/library/storyboard/hideOverlay.html) and there is no mention of returning options in the hideOverlay as there is with showOverlay. To be honest I didn’t read the hideOverlay before just assumed it would be like showOverlay.

Seems logical - I thought it was a good way to present things like buttons, pickerwheel, etc. Get the user input and pass the info back. I do it now with gotoScene. What methods are others using to pop up to get user input ?

Docs are like toilet paper - don’t need it till your in the pooh - then you REALLY need it. [import]uid: 101604 topic_id: 35078 reply_id: 139475[/import]

dbl clicked [import]uid: 101604 topic_id: 35078 reply_id: 139476[/import]

You *could* attach your own data to the storyboard object in your overlay, something like:

storyboard.myReturnedButton="button1"

…and then in the overlayEnded function in the calling module check the value

[code]
function scene:overlayEnded(event)
local group = self.view;
local overlay_name = event.sceneName;

print(storyboard.myReturnedButton);
end
[/code] [import]uid: 70847 topic_id: 35078 reply_id: 139479[/import]

@ingemar… that’s exactly what I am doing now. I create a return variable in the storyboard object.

Would be nice to have params returned though… seems like a cleaner approach. [import]uid: 114363 topic_id: 35078 reply_id: 139487[/import]

Agreed. Would be cleaner… [import]uid: 70847 topic_id: 35078 reply_id: 139490[/import]

I also stumbled across this issue and would like to see a clean solution for this!

I also stumbled across this issue and would like to see a clean solution for this!