composer.showoverlay comes up in background

I have used showoverlay before and it worked as expected.  But this time when I call it the scene loads behind my current scene.  At first I didn’t think it was doing anything at all until I set my current scene elements to transparent.  Then I could see the overlay in the background. 

I have racked my brain and can’t figure out what could cause this.  I also set model=true and my my current scene buttons still function.  It is all very strange.  I am looking for ideas to chase down.   Thoughts?  

L

OK,  I changed this:  display.getCurrentStage():insert( UI.frontGroup )

to this: WorldGroup:insert( UI.frontGroup )

where WorldGroup is my the base set like this: local WorldGroup = self.view – add display objects to this group

and all my problems went away.  

I really have to stop copying code out of the sample programs :)    

as long as you keep the display hierarchy in mind you can “safely” do this either way (above or below other display elements, as desired)

display has one and only one (at present, though they leave this “open” for future) “stage” (which itself is just a DisplayGroup), accessible via the method display.getCurrentStage()

when Composer is loaded, it’s creates its own “stage” (which is a DisplayGroup) as a child of the display stage, accessible via the property composer.stage.

when scenes are created, they each have a “view” property (which is a DisplayGroup) which is a child of the Composer stage, layered in the order of scene creation.  “normal” use of Composer will properly handle the layering of any active scene.view’s, so as long as all “scene content” is inserted into the scene’s view, then inter-scene element layering is also properly handled.

“wrongly layered” elements are typically the result of either

  1. failing to insert into ANY group (which then defaults to the display stage, so on top of everything else already there)

  2. inserting into the WRONG group (which could place it above/below other elements, depending on where that parent group is)

but also, maybe,…

  1. loading Composer “late” (after other groups have created in the display stage, so composer.stage will be on top of all of them) and then failing to “rearrange” the set of display groups as actually desired afterward

OK,  I changed this:  display.getCurrentStage():insert( UI.frontGroup )

to this: WorldGroup:insert( UI.frontGroup )

where WorldGroup is my the base set like this: local WorldGroup = self.view – add display objects to this group

and all my problems went away.  

I really have to stop copying code out of the sample programs :)    

as long as you keep the display hierarchy in mind you can “safely” do this either way (above or below other display elements, as desired)

display has one and only one (at present, though they leave this “open” for future) “stage” (which itself is just a DisplayGroup), accessible via the method display.getCurrentStage()

when Composer is loaded, it’s creates its own “stage” (which is a DisplayGroup) as a child of the display stage, accessible via the property composer.stage.

when scenes are created, they each have a “view” property (which is a DisplayGroup) which is a child of the Composer stage, layered in the order of scene creation.  “normal” use of Composer will properly handle the layering of any active scene.view’s, so as long as all “scene content” is inserted into the scene’s view, then inter-scene element layering is also properly handled.

“wrongly layered” elements are typically the result of either

  1. failing to insert into ANY group (which then defaults to the display stage, so on top of everything else already there)

  2. inserting into the WRONG group (which could place it above/below other elements, depending on where that parent group is)

but also, maybe,…

  1. loading Composer “late” (after other groups have created in the display stage, so composer.stage will be on top of all of them) and then failing to “rearrange” the set of display groups as actually desired afterward