Hi,
I am moving 3 objects from the top to down of the screen. I am using the transition.to API in order to achieve this effect. The 3 objects start from the same position Y=0.
The problem: The 3 object are not horizontal align (i.e. when the object moving down the screen the Y location of the 3 objects are not the same)
Is there a way that when using the transition.to I can Sync between the 3 objects?
Few notifications:
-
A solution of grouping the 3 objects and transition the group is not feasible solution as these 3 objects are involved in collision (using the Physics engine) and as of that collision cannot be detected on different groups
-
Don’t provide solution to replace the Transition.to to the form of manual movement by altering the X value of each object in the enterFrame event
-
I have also put the transition.to lines immediately follow each one
The code is something like this :
local object1 = display.newImageRect(params.group,params.image,iWidth,iHeight)
local object2 = display.newImageRect(params.group,params.image,iWidth,iHeight)
local object3 = display.newImageRect(params.group,params.image,iWidth,iHeight)
object1.y =0; object2.y =0; object3.y =0
transition.to(Object1,{PARAMETERs… ,
onStart = function()
– Do something
end ,
onComplete = function(obj) – Do something
end } )
transition.to(Object2,{PARAMETERs… ,
onStart = function()
– Do something
end ,
onComplete = function(obj) – Do something
end } )
transition.to(Object3,{PARAMETERs… ,
onStart = function()
– Do something
end ,
onComplete = function(obj) – Do something
end } )
Thanks
Yuval