2015-05-05 38 views
2

我试图在游戏中扔星星。 我可以如何在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 }) 

旋转的事情,但我怎么做平移和旋转发生在同一时间?

回答

0

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

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

transition.to(rect, {x=-250, rotation = rect.rotation-360,time=2000,}) -- Transition call 
+1

感谢您的回答。它像一个魅力。 – cbrands