cocos creator~用skewTo实现翻牌效果
程序员文章站
2024-03-16 20:46:04
...
turn(targetSpriteFrame){
let t = this.turnDuration_;
this.cardSprite_.node.runAction(
cc.sequence(
cc.spawn(
cc.scaleTo(t, 0, 1),
cc.skewTo(t, 0, 20)
),
cc.callFunc(()=>{
this.cardSprite_.spriteFrame = targetSpriteFrame
this.cardSprite_.node.skewY = -20;
}),
cc.spawn(
cc.scaleTo(t, 1, 1),
cc.skewTo(t, 0, 0)
),
)
);
},
上一篇: cocos2dx 像素碰撞
下一篇: 简单手势判断(二)