Cocos2dx 常见动作

1.MoveTo/MoveBy

MoveTo(duration,pos):在duration这么一段时间内直线移动到position为pos的地方

MoveBy(duration,pos):在duration这么一段时间内直线移动position距离的地方

2.ScaleTo/ScaleBy

ScaleTo(duration,xBei,yBei):在duration这么一段时间内放大到多少倍

ScaleBy(duration,xBei,yBei):在duration这么一段时间内放大多少倍

3.FadeIn/FadeOut

FadeIn(time):渐变出现,整个过程时间为time

FadeOut(time):渐变消失,整个过程时间为time

4.Spawn/Sequence

Spawn:动作一起执行

Sequence:动作顺序执行

5.RotateBy/RotateTo

RotateBy:在时间time内旋转rotation角度

RotateTo(time,rotatation):在时间time内旋转到rotation角度

6.Repeat/RepeatForever

Repeat(action,times):动作重复times次

RepeatForever:动作永远重复执行

7.JumpBy/JumpTo

JumpBy(time,pos,height,times):在时间time内跳times次每次跳height这么高跳目标位置pos这么高

JumpTo(time,pos,height,times):在时间time内跳times次每次跳height这么高跳到目标位置pos

8.DelayTime

DelayTime(time):创建一个延时动画,延时多少秒执行动画。

9.Blink

Blink(time,times):在时间time内闪烁times次。

10.EaseSineIn/EaseSineOut

EaseSineIn:动作由慢到快

EaseSineOut:动作由快到慢

11.Speed

Speed(action,speedBeishu):动作加快speedBeishu倍。

12.CallFunc

CallFunc:回调函数

例子:

cc.CallFunc:create(function(sender, v)
                            sender:setVisible(false)
                            self:refreshOutCards(v.pos, v.value)
                            self:refreshHands(v.pos)
                           

                            if v.pos == 1 then
                                local tag = self.m_UIMyOutCard:getTag()
                                self.m_UIoutCardList[v.pos]:setPosition(cc.p(self.m_handerCardPos[tag][1],self.m_handerCardPos[tag][2]))
                                self.m_selectIndex = 0
                            end
                        end, {idx = index, value = lenOutCards, pos = pos, cards = handCards})

 

 

 

转载于:https://my.oschina.net/andyzzh1314/blog/1818582

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值