1
local rect = display.newRoundedRect(200, 200, 150, 150, 2)
rect.fill = {0,0,0}
rect.alpha = 0.1
rect.xScale = 0.1
rect.yScale = 0.1
transition.to(rect, {time=1000, xScale=1, yScale=1, alpha=1}) -- transA

local function moveListener()
      transition.moveTo(rect, {time=800,x=300, y=300}) -- this will puase transA!!
end

timer.performWithDelay(400,moveListener, 1)

Any idea how to perform moveTo() without stopping other transitions?

Cheers!

greatwolf
  • 20,287
  • 13
  • 71
  • 105
Abdullah
  • 9
  • 3
  • You should NOT use more than 1 transition to change ONE object properties, think this: `transA = transition.to(rect, {time=800,x=300, y=300})` & `transB = transition.to(rect, {delay=100,time=800,x=0, y=100})` ,how the `rect` doing after 100ms later? – Albert Dec 24 '15 at 02:38
  • I beleive it is OK to perform 2 transactions at a time. In my case, transA is just scaling the object and the other transition is to move it. – Abdullah Dec 27 '15 at 22:50
  • But this is a bad habits; You can use `transition.moveTo(rect, { delay = 400, time = 800, x = 300, y = 300 })` instead of `timer. performWithDelay (400,XXX)` – Albert Dec 28 '15 at 08:02
  • Ok this may be a better practice, but the issue is still exist. – Abdullah Dec 28 '15 at 22:51
  • I tried `transition.moveTo(rect, { delay = 400, time = 800, x = 300, y = 300 })` the issue is not exist…… I used Corona Simulator 2015.2731 – Albert Dec 29 '15 at 04:31

2 Answers2

0

I just tried this on my computer, and it seems to be an issue with transition.moveTo().

It works using transition.to().

Ulydev
  • 343
  • 4
  • 10
  • Yah, I already tried it, My point is as I noticed, moving objects using `transition.moveTo()` is smoother than `transition.to()`. – Abdullah Dec 27 '15 at 22:54
  • Strange. As the Corona SDK docs state, these are only **shortcuts** and shouldn't affect performance. https://docs.coronalabs.com/daily/guide/media/transitionLib/index.html#convenience – Ulydev Dec 27 '15 at 23:03
-1

I just tried the following:

 local rect1 = display.newRoundedRect(100, 100, 150, 150, 2)
  rect1.fill = {0,0,0}

  local rect2 = display.newRoundedRect(300, 100, 150, 150, 2)
  rect2.fill = {1,0,1}

  transition.moveTo(rect1, {time=1000, y=500})
  transition.to(rect2, {time=1000, y=500})

And noticed that rect1 moved after rect2 with some delay!. However, adding small delay to transition.to() will make the movement exactly identical as follows:
transition.to(rect2, {delay=1, time=1000, y=500})

To summerize, it is still an issue with moveTo() to stop other transitions. As work around, in order to get exact behavior just use transition.to() with micro delay as previous line of code!

Thanks.....

Abdullah
  • 9
  • 3