Shadow effect when dragging

Hi
Do you have any idea how to make this effect when we dragging objects ?

http://erro.pl
Take a look on mouse cursor.

I don’t want to use joints, object has to be static.
Maybe drawing another object, this one that we touching make invisible and this new one move with delay or something ?
Any idea ? :slight_smile:
[import]uid: 13156 topic_id: 18806 reply_id: 318806[/import]

The blur effect ?

You can achieve a drag delayed effect looking at the Sample code >> DebugDraw >> StartDrag function. Using a temp “touch” Joint and playing with damping, frequency, etc. [import]uid: 55808 topic_id: 18806 reply_id: 72405[/import]

Will be nice but blur effect is unavailable right now I guess…
I mean this “delay” in a move.

I made something like this

if “moved” == phase then
t.x = t.x + (event.x - t.x) * 0.1200
t.y = t.y + (event.y - t.y) * 0.1200
end

In onTouch function but it’s no working 100% correctly.
[import]uid: 13156 topic_id: 18806 reply_id: 72406[/import]

Yes I can use joints I know but my objects have to be static. touch joints works only with dynamic body. [import]uid: 13156 topic_id: 18806 reply_id: 72407[/import]

Transform the static object into a dynamic object or made a copy-object solution.

When you touch the static object, made a dynamic new display.object (a exact copy of the static) and made invisible the static. (isVisible=false). Play with damping ,frequency to get your elastic/delayed effect using the touch joint and move the dynamic copy.

When you end the drag function, move the invisible object to the ended x,y position and destroy the dynamic. The player will see only one object moving.

This is transparent to the player so you achieve the effect you want [import]uid: 55808 topic_id: 18806 reply_id: 72413[/import]

Hi
Thank you for trying help jose2
This is my solution :

local function onTouch( event )  
 local t = event.target  
 local ratio = .120000  
  
 local phase = event.phase  
 if "began" == phase then  
 display.getCurrentStage():setFocus( t )  
 t.isFocus = true   
 t.x0 = event.x - t.x  
 t.y0 = event.y - t.y  
 event.target:setLinearVelocity( 0, 0 )  
 event.target.angularVelocity = 0  
  
 elseif t.isFocus then  
 if "moved" == phase then  
 t.x = t.x + (event.x - t.x)\* ratio  
 t.y = t.y + (event.y - t.y)\* ratio  
 elseif "ended" == phase or "cancelled" == phase then  
 display.getCurrentStage():setFocus( nil )  
 t.isFocus = false  
  
 end  
 end  
 return true  
end  

[import]uid: 13156 topic_id: 18806 reply_id: 72429[/import]