on a touch/move event create a circle … make sure to destroy so that you don’t start to eat memory…
really really rough code to get you going and I mean very crude way to see if this is what you mean. I don’t know if it is going to work or not as I didn’t test… this was off my brain…
[code]
local function drawDrag(event)
local phase = event.phase
if “began” == phase then
– Make target the top-most object
local cc = display.newCircle ( event.x, event.y, 4);
cc:setFillColor(255,0,0);
elseif “moved” == phase then
– Make object move (we subtract t.x0,t.y0 so that moves are
– relative to initial grab point, rather than object “snapping”).
local cc = display.newCircle ( event.x, event.y, 4);
cc:setFillColor(255,0,0);
elseif “ended” == phase or “cancelled” == phase then
moved = FALSE;
end
return true
end
Runtime:addEventListener(“touch”,drawDrag);
[/code] [import]uid: 24 topic_id: 4472 reply_id: 14029[/import]