如何在Corona中同时移动和旋转图像?

时间:2015-05-05 09:08:33

标签: lua corona

我试图在游戏中投掷星星。 我可以用

移动明星
bulletTransition[bulletCounter] = transition.to(bullets[bulletCounter], {x=-250, time=2000, onComplete=function(self)
        if(self~=nil) then 
            display.remove(self)
        end
        end})

我知道我可以用

旋转东西
transition.to( bullets[bulletCounter], { rotation = bullets[bulletCounter].rotation-360, time=2000, onComplete=spinImage } )

但是如何让翻译和轮换同时进行?

1 个答案:

答案 0 :(得分:0)

您可以在一次转换中同时调用两者。就像:

local rect = display.newRect(300,100,50,50) -- Create object

transition.to(rect, {x=-250, rotation = rect.rotation-360,time=2000,} ) -- Transition call
相关问题