Parenting Display Images

Hello, I’m new here with using Corona SDK and just started building my app. I was wondering how I would go about parenting an image onto another so that it’s position is relative to its parent and not the screen.

This might help explain what I mean.

local screenW, screenH = display.contentWidth, display.contentHeight local imageParent = display.newImageRect("image.png", 200, 200) imageParent.x = screenW/2 imageParent.y = screenH/2 local imageChild = display.newImageRect("image2.png", 50, 50) imageChild.x = 0 imageChild.y = 0 --It is not in the top left corner of screen, but in the top left of imageParent

This is something I really miss, but unfortunately you can’t parent images together. Only groups objects can be parents (this includes containers, groups, snapshots and basically all the display object with the proper :insert function).
If you need for an image to be relative to the position of another image, you either need to offset that continuosly in an enterFrame function (on a frame by frame basis), or create a display group, put the image you want as a parent in it at position 0, 0, and then add the second image to it as well. You would then move the group instead of the first image, and the second image would follow, since it’s a child of the group.

This is something I really miss, but unfortunately you can’t parent images together. Only groups objects can be parents (this includes containers, groups, snapshots and basically all the display object with the proper :insert function).
If you need for an image to be relative to the position of another image, you either need to offset that continuosly in an enterFrame function (on a frame by frame basis), or create a display group, put the image you want as a parent in it at position 0, 0, and then add the second image to it as well. You would then move the group instead of the first image, and the second image would follow, since it’s a child of the group.