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 [import]uid: 96383 topic_id: 16597 reply_id: 316597[/import]

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)

[import]uid: 33608 topic_id: 16597 reply_id: 62002[/import]

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,

?:slight_smile: [import]uid: 3826 topic_id: 16597 reply_id: 62003[/import]

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.

[import]uid: 61600 topic_id: 16597 reply_id: 62013[/import]

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:

[lua]
donkTarget.x = donkey.x +30
donkTarget.y = donkey.y - 5

[/lua]

to keep their relationship stable. But using that code, which gives me accurate bounces, does not let me rotate both objects, because while the image of donkey is rotating, apparently its x and y remain the same. Does this make sense? And if so, any suggestions? [import]uid: 96383 topic_id: 16597 reply_id: 62016[/import]