Hi,
I have been meaning to write this for a long time so please Corona staff hear us out. We are in the middle of the process of migrating all of our apps from the G1.0 engine to G2.0, but we’ve hit a MAJOR obstacle with the G2.0 engine that will force us to have to rewrite the design and layout of ALL of our apps, entirely from scratch. Our apps aren’t small either, have been developing them and building on to them constantly every day since the early spring of 2012. So our apps are by now extremely large and contain tons of different pages, functionalities and designs - having to rewrite all of it, almost 2 years worth of code, just to be able to migrate from one graphics code to the other without any real benefit except being up to date with some changes made under the hood is something we really wish to skip. Do not get us wrong we really appreciate the work and effort you guys have put into making the transition as simple and smooth as possible, but with this obstacle all of that goes down the drain as we’d still have to rewrite almost everything, just to adapt and make the code work with the new functionalities and behaviors of the new groups.
So, what is the problem we’ve encountered? Previously when you inserted objects into a group, the objects inserted could be placed anywhere on the x/y axis to form a perfect alignment between them, and the group they were inserted to was not affected at all by these x/y values. It had its own x/y that were completely independent. So you could align multiple objects on the screen, then insert them into a group, then place that group anywhere on the screen - just like how Photoshop groups can position multiple layers together. We could then insert this group to yet another group and again, position this new group anywhere on the screen regardless of the x/y values of the previous nested groups. I will try illustrate it below with code for creating a quick tabbar.
local tabbarGroup = display.newGroup() -- Tab bar background local background = display.newRect(0, 0, 320, 50) background:setReferencePoint(display.TopLeftReferencePoint) background.x = 0; background.y = 0; background:setFillColor(100, 100, 100) tabbarGroup:insert(background) -- Buttons group local buttonsGroup = display.newGroup() tabbarGroup:insert(buttonsGroup) -- Create buttons local buttons = {} for i=1, 3 do buttons[i] = display.newRect(0, 0, 40, 40) buttons[i]:setReferencePoint(display.TopLeftReferencePoint) buttons[i].x = (i-1)\*50; buttons[i].y = 0; buttonsGroup:insert(buttons[i]) end -- Position tabbar buttons buttonsGroup:setReferencePoint(display.CenterLeftReferencePoint) buttonsGroup.x = 0; buttonsGroup.y = background.height\*.5; -- Finally position the outermost group tabbarGroup:setReferencePoint(display.BottomCenterReferencePoint) tabbarGroup.x = display.contentCenterX; tabbarGroup.y = display.contentHeight;
Now this way, you could quickly and logically position your objects anywhere on the grid, then insert them into a group and collectively position that group anywhere on the grid, and insert that group into another group and position THAT group anywhere on the grid as well regardless of the x/y values of the group children. This made for a VERY effective way to build layouts and create perfect alignments and good design.
Now with the G2.0 however this method completely breaks. We were advised to use the group.anchorChildren property but even with this our old code does not work and needs to be rewritten. We don’t know what anchorChildren specifically does but it sure does not make groups work like before. Now we need to take into account all the group children’s original x/y values when we position objects, which is a little problematic when you have tenfold of objects inside each group nested into several other groups which are all positioned independently. Going through each group individually and calculating their children’s x/y etc on multiple pages in multiple modules is way too much for our code as it is now and it would take us months to fully migrate all our apps to the new engine.
So please can we have an API that imitates the old group’s positioning behavior so we don’t have to rewrite all of our code? As we’d love to stay up to date with your latest innovations and have always done so ever since the beginning, but this migration will require immense effort on our side and in the end we’ll see absolutely no benefit from the migration whatsoever, except just adapting to new group behaviors which will provide no benefit to anyone, not the end users and not to us.
Sorry for the wall of text and thanks for reading! If you know of a solution that we perhaps missed please don’t hesitate to reply