hideOverlay parenting issue - Storyboard

I am having an issue understanding/setting up hideOverlay to access a function from the parent lua file. Im also a bit old school and using Storyboard still, does the same principles apply to that of composer? 

In my game i have the menu.lua scene and the overlay scene called ‘tutorial.lua’ 

In the overlay scene, when I hide the overlay, there is a function called ‘resumeGame’ from menu.lua which I need to call from tutorial.lua. 

I followed the documentation on event.parent but get the following error: 

'Attempt to index local ‘parent’ (a nil value)

Here is my code: 

function hide( event ) local parent = event.parent parent:resumeGame() storyboard.hideOverlay({"fromTop"}) end button = widget.newButton({ left=100, top=200, id="gotIt", label="Got it", onEvent=hide}) button.x = \_W/2 button.y = \_H/2 + 220 button.alpha = 0 group:insert(button)

I don’t believe that storyboard supports event.parent. In Storyboard when the overlay is hidden, the parent gets an exitScene() event, and there is an entry in that event table that has the name of the scene that exited.

Rob

Hey Rob thanks for that. I managed to find a way of pulling a function from another scene via this thread which works fine in this case

Sorry to bring this post back up, I just wanted to add if its possible to make an overlay bring up another overlay. So imagine one of those ‘How to play’ scenes where the player reads the rules/controls etc and hits (or swipes) to bring up a 2nd page of more rules/instructions. 

is this possible? or would it better to just use new scenes for each one instead? 

Cheers 

There can only be one overlay active at a time. If an overlay opens another overlay, the previous one is closed.

Rob

I don’t believe that storyboard supports event.parent. In Storyboard when the overlay is hidden, the parent gets an exitScene() event, and there is an entry in that event table that has the name of the scene that exited.

Rob

Hey Rob thanks for that. I managed to find a way of pulling a function from another scene via this thread which works fine in this case

Sorry to bring this post back up, I just wanted to add if its possible to make an overlay bring up another overlay. So imagine one of those ‘How to play’ scenes where the player reads the rules/controls etc and hits (or swipes) to bring up a 2nd page of more rules/instructions. 

is this possible? or would it better to just use new scenes for each one instead? 

Cheers 

There can only be one overlay active at a time. If an overlay opens another overlay, the previous one is closed.

Rob