well without seeing the code with some comment about what you want it to do it will be hard to help.
Oh ok :P. I have a feeling that the problem is not that the square vanishes, but it is moved off the screen for some reason, when I’m trying to get it in the middle of the screen. I tried subtracting 30 from it and I saw it in the upper corner so yeah :P.
Note that when you are moving a display group (display.newGroup), the x-Position will be 0 wherever it is created.
For example if the display group is in the center of the screen, the “displaygroup.x is 0”. Same to y-position.
@yosu as far as I know that only holds in G2 if anchorCildren is false. In compatibility mode groups have x and y as they did in G1
I’m still a bit confused. I’ve read in the “Learn Corona SDK Game Development” book that I have that sometimes it’s positioned based on left corner and sometimes its based on center depending on how you are positioning it code wise or something like that.
@rothgerry, last fall we changed our graphics engine to make positioning more consistent. Whenever you pass an X, Y to a display.* function to create a new object, the value is the center of the object. In the old graphics engine it was sometimes the center and sometimes the top left corner. All calls should be consistent now.
There are a bunch fo resources, like the learning books that have not been updated or possibly and older version, that may still tell you how to do things the old way.
Rob
Ahh ok thanks a ton! So now it’s always the center unless you specifically call display.setReferencePoint whether you are positioning it from the function or changing the value after calling the function. Is this correct?
Well graphics 2.0 gets rid of setReferencePoint in favor of Anchor Points. They do basically the same thing.
http://coronalabs.com/blog/2013/10/15/tutorial-anchor-points-in-graphics-2-0/
http://docs.coronalabs.com/guide/graphics/transform-anchor.html
Ok thanks!