【问题标题】:How to move and rotate an image at the same time in Corona?如何在 Corona 中同时移动和旋转图像?
【发布时间】:2015-05-11 03:54:34
【问题描述】:

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

移动星星
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 } )

但是如何让平移和旋转同时发生呢?

【问题讨论】:

    标签: lua coronasdk


    【解决方案1】:

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

    local rect = display.newRect(300,100,50,50) -- Create object
    
    transition.to(rect, {x=-250, rotation = rect.rotation-360,time=2000,} ) -- Transition call
    

    【讨论】:

      猜你喜欢
      • 2011-11-22
      • 2015-03-17
      • 1970-01-01
      • 2011-09-08
      • 1970-01-01
      • 2017-02-16
      • 1970-01-01
      • 2011-06-09
      • 2013-03-23
      相关资源
      最近更新 更多