[FIXED] Transitions jerky

Your post title talks about jerky movement but the last sample you posted shows a bug in the transition code where it’s using the box.y value at the time the transition was setup. Are you still seeing jerky transition too (compared to g1.0)? Your bug report only mentioned the box.y positioning issue.

My actual app shows this behavior when I drag a group (slideview) and thus the transitions appeared to be jerking around on the drag, hence the title of the post. The real problem is what I reported.

We resolved the bug that was the result of setting “anchorChildren = true” on a group with only one child. Here is what I replied in the bug report.

The bug has been fixed but it’s not the bug you reported. The bug was the rect moving down in the Y direction during the first transition. The transition shouldn’t move the object at all because anchorChildren was set to true and there was only one child in the group. Your first transition was trying to move the child and not the group.

When you set “anchorChildren = true”, you are settings the group bounds to that of it’s children. Since you only have one child in the group, it’s bounds becomes the bounds of the group. Your first transition attempts to move the child within the bounded group. Since the group bounds and the child bounds are the same, there is no movement. If you had multiple children or did a transition on the group itself, you may see movement (depending on the direction).

When you set “anchorChildren = false” (default condition), the group is not bound by the children (has an infinite boundary) and doing a transition of the child, moves the child in the group.

Setting “anchorChildren = true” on groups is not a good idea unless you have a specific need for using anchor points on groups.

Thanks for the update. 

My understanding that groups prior to G2 where anchoring children. I seem to be misunderstanding that? 

My main method is to position stuff inside the group, then I move the group to where I want it. So I construct something like a footer at 0,0 and then move the final footer group to the bottom. So when porting my project to G2 I put anchorChildren in multiple places. 

Regarding this point in original post:

I also notice alpha transition that are dragged off screen and should still complete normally are not completing fully.

I got around to tracking it down. When groups are going off screen in mid transition, and then come back onscreen, the transition never finished. Try this code:

[lua]local group = display.newGroup()

local box = display.newRect(50,50,100,100)

group.alpha = 0

group:insert(box)

– Transition the group to full alpha in 800 ms

transition.to(group, {alpha = 1, time = 800})

– Transition group offscreen where  above transition will not finish

– Oncomplete, bring it back, it will not be 100% white since 

– alpha transition above did not finish.

transition.to(group, {x = -200, time = 900, onComplete = function() group.x = 0; end})

[/lua]

I reported case 28784.