Cancel Drag -> move to start position

Get help using Construct 2

Post » Tue Apr 24, 2012 8:41 am

Hi,

Is there a way to cancel a drag action, and force the item to move back to its start position, but animated, with dt?

Currently I do this manually, and it is quite a mission.

Tks
B
40
S
8
G
6
Posts: 58
Reputation: 6,795

Post » Tue Apr 24, 2012 10:25 am

@JACLEMGO I did something along these lines by saving item x/y values on drag start and setting the item location back to those when certain things happen (like collisions or what ever you wish to be the cancel action). Adding animation to that shouldn't be too hard, dont take my word for it though :)vee412012-04-24 10:26:00
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Apr 24, 2012 11:02 am

Yeah, just use a variable for the return, and the start positions like:
object variable return =1
object set position to lerp(self.x,startx, 1-0.5^dt), lerp(self.y, starty,1-0.5^dt)
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Apr 24, 2012 12:20 pm

@newt Tks, that is exactly what I was looking for!
B
40
S
8
G
6
Posts: 58
Reputation: 6,795


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Yahoo [Bot] and 21 guests