Hi, Folks-
I would really appreciate some pointers towards solving a problem I’m having. Because the code is so specific, I’m hoping I can find a solution by presenting some general information first, and if necessary, will include actual code later.
I’m building an app using the storyboard module, and in this app I’m calling in another module that displays graphics to be used as buttons. These buttons are meant to remain onscreen consistently throughout the app’s lifetime, through all scene changes, so I’m unconcerned (perhaps erroneously) about the global nature of the module. I’m requiring this button module in main.lua, and the buttons are showing up where they are supposed to, and working as they are supposed to.
The problem I’m running into is layering. My background graphics, which are being brought in as display.newRect objects, and inserted into the scene’s self group, are layering appropriately throughout scene changes. However, my sprite animations (which are draggable) overlay the button graphics, which is undesirable.
I’m building my animated sprites by creating a spritesheet as per the “simple” method (described in Jonathan Beebe’s article- http://www.coronalabs.com/blog/2012/03/06/image-sheets-image-groups-and-sprites/), and then completing the process by declaring the sprite via “display.newSprite(imageSheet, sequenceData).”
What I’ve noticed is that the objects that layer properly are the ones that have been successfully inserted into the scene’s self view (local group = self.view), after being instantiated as “newRect” objects. If I try to insert my sprite animations into the self view, I’m unsuccessful.
Things I have tried, unsuccessfully-
-
Creating a new display table for the buttons, and inserting the buttons into this table, and using the “toFront” function, calling the module both from the main.lua file, as well as trying calling it from individual scene files, to no avail in either case.
-
Loading the spritesheet into a display.newRect object, and inserting that into the self.view group. This screws up my sequenceData possibilities, though.
Any help, tips, pointers, etc. would be greatly appreciated! And I hope you’ll forgive me for using the term “object” where “table” is probably more appropriate. It’s a leftover Flash habit. 
Thanks!