间接动作
--2秒钟移动到指定位置
local moveTo = cc.MoveTo:create(2,cc.p(display.cx * 2 ,display.cy * 2))
self.myImage:runAction(moveTo)

--2秒钟移动到相对自身的指定位置
local moveby = cc.MoveBy:create(2,cc.p(300,200))
self.myImage:runAction(moveby)

--上下串20px 10次后到指定位置
local jumpto = cc.JumpTo:create(2,cc.p(display.cx*2,display.cy),20,10)
self.myImage:runAction(jumpto)

--上下串20px 10次后到达相对自身的指定位置
local jumpby = cc.JumpBy:create(2,cc.p(-300,0),20,10)
self.myImage:runAction(jumpby)

--沿着相对自身位置的贝塞尔曲线运动
local bezier = {
    cc.p(0,0),
    cc.p(300,500),
    cc.p(600,0)
}
local bezierby = cc.BezierBy:create(2,bezier)
self.myImage:runAction(bezierby)

--2秒后缩放到 2x,3y
local scaleto = cc.ScaleTo:create(2,2,3) --duration,x,y
self.myImage:runAction(scaleto)

--2秒后顺时针旋转到180
local rotateto = cc.RotateTo:create(2,180)
self.myImage:runAction(rotateto)

--2秒内闪烁10次
local blink = cc.Blink:create(2,10)
self.myImage:runAction(blink)

--2秒后渐变到指定颜色
local tintto = cc.TintTo:create(2,255,0,0)
self.myImage:runAction(tintto)

--2秒后从指定颜色渐变到原来的颜色
local tintby = cc.TintBy:create(2,0,255,255) --从这个颜色到原来
self.myImage:runAction(tintby)

--2秒内逐渐变到指定透明度
local fadeto = cc.FadeTo:create(2,60)
self.myImage:runAction(fadeto)

--2秒逐渐显现出来
self.myImage:setOpacity(0)
local fadein = cc.FadeIn:create(2)
self.myImage:runAction(fadein)

--2秒逐渐隐藏
local fadeout = cc.FadeOut:create(2)
self.myImage:runAction(fadeout)

首页 我的博客
粤ICP备17103704号