Skip to content

Instantly share code, notes, and snippets.

@fanfq
Created March 6, 2020 03:02
Show Gist options
  • Save fanfq/047e627cdb71c95d2d4afa2b8e20279e to your computer and use it in GitHub Desktop.
Save fanfq/047e627cdb71c95d2d4afa2b8e20279e to your computer and use it in GitHub Desktop.
ccc learning step by step
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();
}
@fanfq
Copy link
Author

fanfq commented Mar 6, 2020

cc.tween有两种主要的设置方式:
to 改变到某个值
by 变化值

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment