In page 1.lua, we have groups and tables defined as such:
image = {}
pageGroup = display.newGroup()
gp = {}
gp.mNav = display.newGroup( )
gp.fc = display.newGroup( )
gp.back = display.newGroup( )
We are passing this data into a module called pList like so:
pList.drawScreen1({image = image, imageData = imageData.nav, pageGroup = pageGroup, gp = gp })
Here is a look at the kind of info that is in table imageData.nav that is being passed into pList.drawScreen
{ group="mNav", gen="imageRect", rgb=nil, alpha = 0.5, name="bmshad", imgFile="mn\_bmshad", w=190, h=1194, x=1927, y=450-mNavY }, { gen="imageRect", rgb=nil, event=true, alpha=0.4, name="btn\_mNav", imgFile="mn\_bm", w=182, h=1190, x=1927, y=446-mNavY }, { gen="imageRect", rgb=nil, name="hem", imgFile="mn\_hem", w=162, h=1165, x=1927, y=435-mNavY }
Within pList.drawScreen, a function iterates through imageData.nav to turn them into display.newImageRect, circles, sprites etc into the passed in image table.
Then each image is inserted into groups with provided names in the gp table e.g. group=“mNav”
After being put together in the module, they can be accessed in page 1 where the groups were created.
The only problem is, groups always return with their x and y positions as 0. We can access the groups, move them etc but they always return as position 0.
Just wondering if there’s anything that can be done to return the position of the group according to its children which you normally get when you place images into a group in its own scene.