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)