Hi,
I have two layouts, one for landscape and one for portrait (for mobile).
They both have the same event sheet attached.
However, when the player switches from one to the other, the layouts objects are destroyed, and I lose game state (as I was storing the game state in the objects parameters.
I need to restore game state on layout switch.
I tried adding an "on start of layout" event, but this fires if you resize the same layout, so not useful in this case.
I can see a few ideas:
1) store the layout state (portrait or landsape) in globals. I try and avoid globals for state where possible as they are difficult to manage in complex conditions.
2) possibly detach the single event sheet from both layouts, and attatch separate event sheets that do something only once on switching to that layout, then include the main event sheet. However, I dont know what that event might be?
3) other cunning strategy?
Thanks!