possible bug with image positioning?

Example project: http://www.filedropper.com/scroller

I think I'm running into a bug with Corona; that or I have a fundamental misunderstanding as to how display groups and their children interact.

Click on a square somewhere, preferably near the middle of the square. In the console you'll notice event.x,event.y which is where you clicked as well as grid_x,grid_y which should match the x,y in grid space of the grid that you touched and finally x,y which should then be the CENTER of the grid you touched in screen space coordinates. It's easy to verify that these calculations are in fact 100% accurate by comparing the numbers.

The problem is that the image is being created with it's reference set to BottomCenter and it's x,y set to the x,y you see in the terminal; center of the clicked grid. In my understanding that would then place that image in that spot... and in fact if you comment out line 62 which is the insertion into the container it DOES appear in the correct location.

Does anyone have any idea what would be causing my images to appear in the wrong place once inserted into the container? I've tried all kinds of combinations of when to insert the image, different reference points for both the container and the image, etc... but nothing else seems to set my grid at 0,0 top left with my images appearing in the right place based on the properly calculated x,y

Best regards,

JD Smith

You might verify that you are not dropping both the container and the image at the touch point. If your event x and y were 100 and you drop the container at the event x/y and then drop the image and the event x/y...you image will actually be at 200,200.

Make sure you are only placing the container at the event xy and then place the image at 0,0 inside the group container.

Not sure if this will help...if I understand you issue correctly.

views:1495 update:2011/10/1 9:04:19
corona forums © 2003-2011