Tips.ts 664 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * tips提示
  3. */
  4. const {ccclass, property} = cc._decorator;
  5. /**
  6. *
  7. * <color=#FFFFFF>获得道具</c><color=#0fffff>服饰卡*1</color>:
  8. */
  9. @ccclass
  10. export default class Tips extends cc.Component {
  11. @property(cc.RichText)
  12. label: cc.RichText = null;
  13. start () {
  14. cc.tween(this.node).sequence(
  15. cc.delayTime(0.3),
  16. cc.spawn(
  17. cc.moveBy(2,cc.v2(0,60)).easing(cc.easeSineOut()),
  18. cc.fadeOut(2),
  19. ),
  20. cc.callFunc(()=>{
  21. this.node.destroy();
  22. })
  23. ).start()
  24. }
  25. public setLabel(str){
  26. this.label.string = str;
  27. }
  28. }