Display Groups coords when using graphicsCompatibility = 1

I am running one of my older games in graphicsCompatibility = 1 mode… 99% is ok, but I am finding that my display groups position translations are broken.

for example:

transition.to( levelGroup, { time=2000, x=-240, y=0, xScale=0.5, yScale=0.5, transition=easing.inOutQuad } )

… doesnt position my levelGroup correctly any more. Its hard to show full code or screenshot.

I presumed enabling graphicsCompatibility, meant my top left coords remained in tact? Is this same for display groups?

Cheers guys

Richie

… Seems the problem arises when the group is scaled… when group is left at scale 1 then any of code controlling position and limits works ok. But when I pinch and zoom to scale < 1… any code that controls position and limits of the group is broken…

I know this is vague… I’ll try create some sample code to recreate it. Unless in the meantime you guys know there is an issue that can be easily fixed.

Cheers

Possible cause… x,y coords in graphicsCompatibility = 1 mode… remain at top left corner… but scale is now occuring at new center coords???

Ok… seems the point at which a display group scales changes depending on graphics compatibility setting

Ive amended the Polygon sample code… to this

-- -- Abstract: PolyLines sample app, demonstrating how to draw shapes using line segments -- -- Version: 1.0 -- -- Sample code is MIT licensed, see http://www.coronalabs.com/links/code/license -- Copyright (C) 2010 Corona Labs Inc. All Rights Reserved. local vertices = { 0,-110, 27,-35, 105,-35, 43,16, 65,90, 0,45, -65,90, -43,15, -105,-35, -27,-35, } test = display.newGroup() local x,y = display.contentCenterX, display.contentCenterY local o = display.newPolygon( x, y, vertices ) o:setFillColor( 255, 0, 0 ) o.fill = { type="image", filename="aquariumbackgroundIPhone.jpg" } --o.fill = nil o.strokeWidth = 10 o:setStrokeColor( 0, 255, 255 ) test:insert(o) transition.to( test, { time=2000, xScale=0.5, transition=easing.inOutQuad } )

Add the

graphicsCompatibility = 1,

to the config and try it out… remove it and try it out.

Is this the correct behaviour!? I thought by adding this to my config… my older projects coord system would be left intact.

Cheers

Ok, seems having graphicsCompatibility = 1 in the config, makes display groups scale around the center… instead of remaining at top left.

In my opinion, this should remain top left if I add graphicsCompatibilty = 1 to my config.

Now, if I dont, and for future reference… where should the groups center of scale be in Graphics 2.0?

Cheers

bump…

I was able to reproduce the group scaling issue and we are looking into the issue. Thanks for posting the bug.

One thing about using new graphics 2.0 APIs (e.g. display.newPolygon). They don’t have a v1 compatibility mode so they are constructed with x,y (center) vs. TopLeft like other v1 display objects.

Thanks Tom
Yeah I understand cheers. I just expect my groups to scale around same point (top left) in G 2.0 with graphics compatibilty = 1
Cheers

This should be fixed in next daily build (2007 or after).

Thanks Walter… :slight_smile:

Richie

… Seems the problem arises when the group is scaled… when group is left at scale 1 then any of code controlling position and limits works ok. But when I pinch and zoom to scale < 1… any code that controls position and limits of the group is broken…

I know this is vague… I’ll try create some sample code to recreate it. Unless in the meantime you guys know there is an issue that can be easily fixed.

Cheers

Possible cause… x,y coords in graphicsCompatibility = 1 mode… remain at top left corner… but scale is now occuring at new center coords???

Ok… seems the point at which a display group scales changes depending on graphics compatibility setting

Ive amended the Polygon sample code… to this

-- -- Abstract: PolyLines sample app, demonstrating how to draw shapes using line segments -- -- Version: 1.0 -- -- Sample code is MIT licensed, see http://www.coronalabs.com/links/code/license -- Copyright (C) 2010 Corona Labs Inc. All Rights Reserved. local vertices = { 0,-110, 27,-35, 105,-35, 43,16, 65,90, 0,45, -65,90, -43,15, -105,-35, -27,-35, } test = display.newGroup() local x,y = display.contentCenterX, display.contentCenterY local o = display.newPolygon( x, y, vertices ) o:setFillColor( 255, 0, 0 ) o.fill = { type="image", filename="aquariumbackgroundIPhone.jpg" } --o.fill = nil o.strokeWidth = 10 o:setStrokeColor( 0, 255, 255 ) test:insert(o) transition.to( test, { time=2000, xScale=0.5, transition=easing.inOutQuad } )

Add the

graphicsCompatibility = 1,

to the config and try it out… remove it and try it out.

Is this the correct behaviour!? I thought by adding this to my config… my older projects coord system would be left intact.

Cheers

Ok, seems having graphicsCompatibility = 1 in the config, makes display groups scale around the center… instead of remaining at top left.

In my opinion, this should remain top left if I add graphicsCompatibilty = 1 to my config.

Now, if I dont, and for future reference… where should the groups center of scale be in Graphics 2.0?

Cheers

bump…

I was able to reproduce the group scaling issue and we are looking into the issue. Thanks for posting the bug.

One thing about using new graphics 2.0 APIs (e.g. display.newPolygon). They don’t have a v1 compatibility mode so they are constructed with x,y (center) vs. TopLeft like other v1 display objects.

Thanks Tom
Yeah I understand cheers. I just expect my groups to scale around same point (top left) in G 2.0 with graphics compatibilty = 1
Cheers

This should be fixed in next daily build (2007 or after).

Thanks Walter… :slight_smile:

Richie