12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- var t = require;
- var e = module;
- var i = exports;
- var s =
- (this && this.__decorate) ||
- function(t, e, i, s) {
- var o,
- a = arguments.length,
- n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
- else
- for (var r = t.length - 1; 0 <= r; r--)
- (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
- return 3 < a && n && Object.defineProperty(e, i, n), n;
- };
- Object.defineProperty(i, "__esModule", { value: !0 });
- const { ccclass: o, property: a, menu: n, executeInEditMode: r } = cc._decorator;
- e = class extends cc.Component {
- constructor() {
- super(...arguments), (this.label = null), (this.paddingX = 0);
- }
- leftToRight(t = !0, e = 1) {
- return (
- (this.isAutoDestroy = t),
- (this.node.opacity = 0),
- (this.node.x = -cc.winSize.width / 2),
- (this.node.y = 0),
- cc
- .tween(this.node)
- .to(0.3, { x: -50, opacity: 255 }, { easing: "sineInOut" })
- .to(e, { x: 50 })
- .to(0.3, { x: cc.winSize.width / 2 }, { easing: "sineIn" })
- .call(this.showFinish.bind(this))
- .start()
- );
- }
- init(t, e, i = 40, s) {
- return (
- t.addChild(this.node),
- (this.label.fontSize = i),
- (this.label.lineHeight = i),
- (this.label.string = e),
- s && (this.node.color = s),
- this
- );
- }
- showTipSmallToBig(t = !0) {
- (this.isAutoDestroy = t),
- (this.node.opacity = 0),
- (this.node.x = 0),
- (this.node.y = 0),
- (this.node.scale = 0),
- (this.tween = cc
- .tween(this.node)
- .to(0.2, { scale: 1, opacity: 255 })
- .delay(0.8)
- .to(0.5, { opacity: 0 })
- .call(this.showFinish.bind(this))
- .start());
- }
- flyUp(t, e, i = !0) {
- (this.isAutoDestroy = i),
- (this.node.y = e),
- (this.node.x = t),
- (this.node.opacity = 255),
- cc
- .tween(this.node)
- .to(0.1, { scale: 1.1 }, { easing: cc.easing.sineOut })
- .to(0.1, { scale: 1 }, { easing: cc.easing.sineIn })
- .to(0.7, { y: e + 50 })
- .delay(0.2)
- .to(0.3, { opacity: 0 })
- .call(this.showFinish.bind(this))
- .start();
- }
- showFinish() {
- (this.tween = null), this.isAutoDestroy && this.destroyLab();
- }
- destroyLab() {
- this.node.pool ?
- (this.node.pool.push(this.node), (this.node.pool = null)) :
- (this.node.removeFromParent(), this.node.destroy());
- }
- };
- s([a(cc.Label)], e.prototype, "label", void 0),
- s([a()], e.prototype, "paddingX", void 0),
- (e = s([o, r], e)),
- (i.default = e);
|