[RESOLVED] Can we no longer rotate display groups, since they have no anchor points?

I am migrating one of our projects from graphics1.0 to graphics2.0.

We have a bunch of buttons on the level select, which are actually display groups, comprising of about 10 items. They cannot be one single image because they have various components which need to update.

When a button is pressed when using g1.0, it would rotate 360 degrees around it’s center and scale up - however in g2.0 it now rotates around 0, 0 in world space which means it flies around the screen.

This is the transition code:

transition.to(buttonGroups[num], {time = 1000, rotation = 360, xScale = 5, yScale = 5, alpha = 0, onComplete = enterLevel}) 

Is there an easy way around this?

I have tried using containers but clearly I don’t understand them yet. My buttons are arranged in a grid which is 4 wide by 2 high and takes up most of the screen. Every time I add a button to a new container, the container masks the screen from 0, 0 in world space to the w, h values I set when I create it. Even if I move the container or the objects in the container, the mask is still applied from 0, 0 to w, h in world space.  This means that all buttons except the 2 buttons in the top left disappear, because all of the others have been masked.

As soon as I posted this I realised my mistake.

I was positioning the container based on the position that the display group had been in, forgetting that all of the display group’s positions were set to 0, 0 and their objects were placed in the correct position afterwards.

I’ve now positioned the container correctly, and it all works as it should do.

Schoolboy error…

Been there, done that… More times than I care to admit  :wink:

As soon as I posted this I realised my mistake.

I was positioning the container based on the position that the display group had been in, forgetting that all of the display group’s positions were set to 0, 0 and their objects were placed in the correct position afterwards.

I’ve now positioned the container correctly, and it all works as it should do.

Schoolboy error…

Been there, done that… More times than I care to admit  :wink: