Created
March 6, 2020 03:02
-
-
Save fanfq/047e627cdb71c95d2d4afa2b8e20279e to your computer and use it in GitHub Desktop.
ccc learning step by step
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start () { | |
/** | |
//cc.Action 已弃用 | |
let action = cc.repeatForever( | |
cc.sequence( | |
cc.rotateBy(0.3,4), | |
cc.rotateBy(0.3,-8), | |
cc.rotateBy(0.3,4), | |
cc.delayTime(0.5) | |
) | |
); | |
this.startBtn.runAction(action); | |
*/ | |
//新方法 tween https://docs.cocos.com/creator/api/zh/classes/Tween.html?h=tween | |
cc.tween(this.startBtn) | |
.repeatForever( | |
cc.sequence( | |
cc.rotateBy(0.3,4), | |
cc.rotateBy(0.3,-8), | |
cc.rotateBy(0.3,4), | |
cc.delayTime(0.5) | |
) | |
).start(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cc.tween有两种主要的设置方式:
to 改变到某个值
by 变化值