Well I found out how to do what I want with groups and transition.to(). I made 1 group for the main screen ( playfieldScreenGroup ), and 1 group for the preferences screen ( settingsScreenGroup ).
To hide the main (current) screen I do:
transition.to(playfieldScreenGroup, {time=1500, alpha=0})
Then to display the preferences screen I do:
display.getCurrentStage():insert(settingsScreenGroup),
transition.to(settingsScreenGroup, {time=1500, alpha=1.0})
I just reverse the process to redisplay the main screen ( playfieldScreenGroup )
Both screens will always be there so I’m wondering (to prevent the CurrentStage group from growing with numerous insertions of the same two screens) if it is necessary to also remove the opposite screen before insertion of the screen that will be displayed, as in this code (notice the commented out line):
transition.to(playfieldScreenGroup, {time=1500, alpha=0})
-- display.getCurrentStage():remove(playfieldScreenGroup)
display.getCurrentStage():insert(settingsScreenGroup)
transition.to(settingsScreenGroup, {time=1500, alpha=1.0})
currentScreen = 2
[import]uid: 295 topic_id: 1448 reply_id: 4101[/import]