Hi all,
Inside my normal game play scenes, and overlay scenes, I’ve a small line of code, that writes to the composer, when that scenes event code is executed, this is because I’m trying to debug a problem.
When the player clicks on their btnBackPack, my OL1 (Overlay 1 Inventory) lua file is displayed.
EVERYTHING is fine upto this point (coloured green)
12:05:56.132 GP1 SHOW EVENT DID 12:05:58.204 OL1 ============================ 12:05:58.204 OL1 SCENE FILE LEVEL 12:05:58.204 OL1 CREATE EVENT 12:05:58.215 OL1 SHOW EVENT WILL 12:05:58.215 OL1 SHOW EVENT DID
But…
When the player closes clicks on the btnBackPackClose to close the OL1 (Overlay 1 Inventory) lua file, for some reason things go wrong. the close process is calling the overlays SHOW event again (coloured red)!
12:05:59.616 OL1 HIDE EVENT WILL 12:05:59.616 OL1 SHOW EVENT WILL 12:05:59.616 OL1 SHOW EVENT DID 12:06:00.124 OL1 HIDE EVENT DID 12:06:00.124 OL1 DESTROY EVENT 12:06:00.124 OL1 -------------------------
As you can see, the next scene event called is the OL1 HIDE EVENT WILL.
This is correct and expected.
But then the overlay’s SHOW WILL, and SHOW DID events are called AGAIN.
I’ve now commented out every single object created, function written leaving just the button to close the overlay remaining. There is nothing in my code, calling the SHOW WILL/DID events again.
If the entire overlay file was being called, then it’s HIDE EVENTS would show twice, but they do not.
There are no events taking place from the parent scene.
I’ve read over and over all the scene management, composer notes/tutorials etc I can find on the subject.
This double/secondary SHOW event execution in my overlay is screwing my management of parent scene objects.
Thanks
Angela