是否可以在 Corona SDK 中更改 transition.to 中的 x 和 y 坐标

Is it possible to change the x and y coordinates in a transition.to in Corona SDK

我很难弄明白这一点。我想制作一个物体,在我的例子中是一个球,

local ball = display.newCircle(25,25,25)
ball.x = 160
ball.y = -80

从它的起始坐标移动到另一个地方,但是,在动作完成后我希望它立即出现在另一个地方让我们说 x=90 和 y=120 并过渡到另一个地方。我怎样才能用 lua 做到这一点?提前谢谢你。

我不确定我是否理解正确。

下面的代码将球从起始坐标移动到目标坐标。球到达目的地后,球的 x 和 y 坐标更改为 x=90 和 y=120,并调用第二个转换。

local function listener(self)
   -- self== ball in this case
   self.x = 90
   self.y = 120
   transition.to(self, {time=yourTime, x=newDestX, y=newDestY})
end

transition.to(ball, {time=yourTime, x=destX, y=destY, onComplete=listener})

有关 Corona SDK 中转换的更多信息,请阅读 this