GodText.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. e =
  5. (this && this.__decorate) ||
  6. function (t, e, i, s) {
  7. var o,
  8. a = arguments.length,
  9. n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
  10. if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
  11. else
  12. for (var r = t.length - 1; 0 <= r; r--)
  13. (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
  14. return 3 < a && n && Object.defineProperty(e, i, n), n;
  15. };
  16. Object.defineProperty(i, "__esModule", {value: !0});
  17. const s = t("App"),
  18. o = t("GameText"),
  19. {ccclass: a, property: n} = cc._decorator;
  20. t = class extends cc.Component {
  21. constructor() {
  22. super(...arguments), (this.descLab = null), (this.typeTimer = null), (this.cb = null), (this.txt = "");
  23. }
  24. hideText() {
  25. this.node.active = !1;
  26. }
  27. typerFinish() {
  28. (this.typeTimer = null), this.cb && (this.cb(), (this.cb = null));
  29. }
  30. clearTimer() {
  31. (this.descLab.string = this.txt),
  32. this.typeTimer &&
  33. (s.default.TimerManager.remove(this.typeTimer, null), (this.typeTimer = null), (this.cb = null));
  34. }
  35. setText(t, e) {
  36. (this.node.active = !0), (this.cb = e);
  37. t = this.txt = t.i18 ? o.GameText.getTextByStr(t.i18) : t.str;
  38. t && ((this.descLab.node.active = !0), (this.descLab.string = t));
  39. }
  40. };
  41. e([n(cc.RichText)], t.prototype, "descLab", void 0), (t = e([a], t)), (i.default = t);