Hi fellows,
I am either stupid or just tired and old 
I cant get this to work and have been fighting this for one day now. First of all I have a scrollable world thats around 3072 pixels wide and it is a display group. I am placing objects into this group by dragging and dropping - and somehow I managed to get that to work, but I guess the approach isnât 100% bullet proof. Above this display group, I have placed a fixed âviewportâ. I am using this viewport as a âcontainerâ - otherwise - I will lose my events and it will crash.
So second, and here comes my problem. I am picking up the object and start to drag it. What I want to do when I pick it up is to release it from the scrollable world (display group) - just so that my object can be on top of all the other groups in the viewport. There are groups as menus, drawers, etc. I do need to have that object above those, and it cant travel in the back. So thats why I am releasing it from the âmainâ group and adding it to the âviewportâ. Enought about that now 
And itâs now the problem starts. As soon as I pick it up and places the object in the viewport, it is misplaced. No matter what I try I cant get it to work.
if event.phase == "began" then
--Hokus pocus code....no matter what I try it wont be placed exactly
local x\_local, y\_local = event.target:localToContent(event.x, event.y )
-- Move the object into the viewport
viewPort:insert(event.target)
event.target.x = x\_local
event.target.y = y\_local
event.target:toFront();
--Remove it from the background group
mainGroup:remove(event.target)
elseif....
When I place it in the background I am using [lua]âcontentToLocalâ[/lua] - and I assume that I should use [lua]âlocalToContentâ[/lua] now? But I am not sure where I should pick my x and y values from. The mainGroup, event.target, event ? Can someone please fill me in here and handle over the correct spell for this 
Regards, Joakim [import]uid: 81188 topic_id: 32579 reply_id: 332579[/import]