Hi,
I was working on a zoom in function over a special part in my game. This part is a display group and I want it to zoom in and set the positions to the middle of the screen but I seem to have some problems.
If you look at this code:
local bool = false local x = display.contentWidth \* 0.5 local y = display.contentHeight \* 0.5 local rect0 = display.newRect( 50, 50, 50, 50) transition.to(rect0, { x = 200, y = y, delta = bool}) local rect1 = display.newRect( 50, 110, 50, 50) transition.to(rect1, { x = 200, y = y, delta = bool}) local rect2 = display.newRect( 50, 170, 50, 50) local rect3 = display.newRect( 50, 230, 50, 50) local dg = display.newGroup() dg:insert( rect2 ) dg:insert( rect3 ) transition.to(dg, { x = 200, y = y, delta = bool}) print(dg.height, dg.width)
The expected value is the the two “loose” rectangles goes to the set position (which they do) and that the dg also go to that position.
Is this a bug or doesn’t delta work on a display group or am I missing something?
Best regards,
Tomas