When i started corona, i felt as3 programming days back again. It is so much like actionscript 3. Though corona is a framework which is very similar to flash api. So here i am again to talk what i have been doing. I won’t be giving any tutorials, just wanted to share some concepts of things that i came to know when falling in trouble. In corona everything that is drawn or you see in screen are display objects. So i was creating a image display object and just rendering on screen.

local background = display.newImage("purple.png");

It gave the output something like this.

Well seems fine. First width and height of image was 480 * 480. Second, in corona, cartesian was positive 4th quadrant too, i.e top left was the origin (0,0) of a stage. So what it seemed was that image of 480*480 dimension is being rendered at point (0,0) aka top left point of image, at origin of stage. But i don’t know, what made me to print the position coordinates of that image and so i did, i found that position coordinates of image was (240, 240). I was lke wow, my assumption turned out to be wrong. So if position coordinate was (240, 240) then it meant that image was being rendered at point (240, 240) but registration point or reference point of image was definetly at center of image, beacuse come on! look at the output above. Just print the coordinates aaargh.

background.x = 0;
background.y = 0;

Output is now this, since registration point is at center of image.

So now according to documentation

display.newImage( filename [, baseDirectory] [, left, top] ) return image object; if we don't provide [left, top] then the image will be centered about its local origin.

So if you want your registration point on top left of image, then you can provide [left, top] parameter while creating or you can call setReferencePoint later.

Thanks.