Hello,
Someone helped me in the past here by showing me how to create a group that I can move everything around at once with the touch event. So now I am dragging an object over the group and want to insert it where I stop at. I know how to insert an object into a group. But when I’m done dragging I cannot tell what the x/y is right there.
How can I determine this for a layer that I can pan around and also zoom in/out? When I move the object it is the x/y position of the screen. When it is over the layers.content I want to know the x/y at any time. How do I calculate the offset that includes the scaling as well?
Thanks,
Warren
local layers = display.newGroup() layers.container = display.newContainer( layers, 320, 300 ) layers.container.anchorX = 0 layers.container.anchorY = 0 layers.container.anchorChildren = false layers.container.x = 100 layers.content = display.newGroup() layers.overlay = display.newGroup() layers:insert(layers.container) layers:insert(layers.overlay) layers.container:insert(layers.content)