Using Delta Time with transitions

This is the correct way for using Delta Time with transitions, right?

You would multiply dt with the time of the transition:

transition.to( Tmp, {x = Image.x, y = Image.y, delay = math.random(100, 450) , time = ITEMS_TRANS_TIME*bubblesMatch3.dt})

NOT like this :

transition.to( Tmp, {x = Image.x*bubblesMatch3.dt, y = Image.y*bubblesMatch3.dt, delay = math.random(100, 450) , time = ITEMS_TRANS_TIME})

Would you also multiply the dt with the delay?

transition.to( Tmp, {x = Image.x, y = Image.y, delay = math.random(100, 450)*bubblesMatch3.dt, time = ITEMS_TRANS_TIME*bubblesMatch3.dt})

Also, what is params.delta used for? Don’t really understand this.

Hi @burnsj002,

Yes, I believe that multiplying just the time of the transition by the delta is correct. As for the “delta” parameter, it works like this:

  1. Assume you have an object on screen (say at (0,0), and you set the transition to move it x=50 and y=100.

  2. If you do not use the delta parameter (default), it will move specifically to x=50 and y=100 on the screen.

  3. If you do use the delta parameter, and the object happens to be located at (100,100), then it will move to +50 and +100 in relation to its current position. So, in this case it would move to (150,200) because you’re adding +50 and +100 to its current position and stating that it should move in delta relation to its current position.

Hope that clarifies things,

Brent

@Brent

Much Mahalo! It really helps!

Hi @burnsj002,

Yes, I believe that multiplying just the time of the transition by the delta is correct. As for the “delta” parameter, it works like this:

  1. Assume you have an object on screen (say at (0,0), and you set the transition to move it x=50 and y=100.

  2. If you do not use the delta parameter (default), it will move specifically to x=50 and y=100 on the screen.

  3. If you do use the delta parameter, and the object happens to be located at (100,100), then it will move to +50 and +100 in relation to its current position. So, in this case it would move to (150,200) because you’re adding +50 and +100 to its current position and stating that it should move in delta relation to its current position.

Hope that clarifies things,

Brent

@Brent

Much Mahalo! It really helps!