ClcikAction.js 691 B

1234567891011121314151617181920212223242526272829
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. },
  5. // LIFE-CYCLE CALLBACKS:
  6. onLoad() {
  7. // this.node.active = false;
  8. },
  9. start() {
  10. },
  11. onEnable() {
  12. this.node.rotation = 10;
  13. this.node.position = new cc.Vec2(this.node.position.x + 70, this.node.position.y + 170);
  14. this.node.scale = new cc.Vec2(0.3, 0.3);
  15. this.node.opacity = 0.2;
  16. var finished = cc.callFunc(function () {
  17. this.node.active = false;
  18. }, this);
  19. var actions = cc.sequence(cc.spawn(cc.scaleTo(0.2, 1), cc.fadeIn(0.2)), cc.fadeOut(0.1), finished);
  20. this.node.runAction(actions);
  21. }
  22. // update (dt) {},
  23. });