rotate group wackiness

I have two objects in a group and I am trying to rotate that group but instead of spinning around the center axis it seems to be spinning around an axis offscreen somewhere. When I rotate the individual objects it works just fine. What am I doing wrong?

Thanks so much for any thoughts.

Kevin

Have you tried to set the xReference and yReferene of the group? (see: http://developer.anscamobile.com/content/objectxreference)

Alternatively, you can center the reference point of the group with:

yourGroup:setReferencePoint(display.CenterReferencePoint)

it is all got to do with the point registered for rotation, individually, each object would have the centre point, however in a group, it is affected by the positioning of the various objects it holds. So if you want the group to rotate around a particular point, set the xReference and the yReference points accordingly before you rotate the group.

cheers,

?:)

When you do things individually, ya things are defaulted at center. When you do things as a group, trickery comes out to bite you in the ass. You will need to get the Xref and Yref squared away before messing with the group, then once they are in the group you will have to fine tune the ref points.

Thanks, I've tried both approaches to setting the reference point for the group, but there seems to be some conflict with the other code I am using from the Time Animation template. Using the Time Animation code I bounce an object off the edges of the screen, but in the same way there is a conflict rotating a group with that code, there is also a conflict bouncing a group accurately. Thus, I bounce one object in the group, donkey, and use this code:

1
2
3
4
5
        
        donkTarget.x = donkey.x +30
        donkTarget.y = donkey.y - 5
        
        
views:1610 update:2011/10/22 17:28:16
corona forums © 2003-2011