296aa49b-aebf-4d06-9e49-3cbb8f7dc351.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. "use strict";
  2. cc._RF.push(module, '296aaSbrr9NBp5JPLuPfcNR', 'TipPanel');
  3. // Script/view/tipPanel/TipPanel.ts
  4. "use strict";
  5. var __extends = (this && this.__extends) || (function () {
  6. var extendStatics = function (d, b) {
  7. extendStatics = Object.setPrototypeOf ||
  8. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  10. return extendStatics(d, b);
  11. };
  12. return function (d, b) {
  13. extendStatics(d, b);
  14. function __() { this.constructor = d; }
  15. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16. };
  17. })();
  18. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  19. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  20. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  21. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  22. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23. };
  24. Object.defineProperty(exports, "__esModule", { value: true });
  25. var BaseView_1 = require("../../../lightMVC/core/base/BaseView");
  26. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  27. var TipPanel = /** @class */ (function (_super) {
  28. __extends(TipPanel, _super);
  29. function TipPanel() {
  30. return _super !== null && _super.apply(this, arguments) || this;
  31. }
  32. TipPanel.prototype.drawView = function (data) {
  33. this.node.setSiblingIndex(100);
  34. var label = this.ui.getNode("label");
  35. label.getComponent(cc.Label).string = (data) ? data : '';
  36. this.node.stopAllActions();
  37. this.node.position = new cc.Vec3(0, -100, 0);
  38. this.PlayAction();
  39. console.log('tipPanel:**(*******', this.node.getSiblingIndex());
  40. };
  41. /**
  42. * 播放tip动作
  43. */
  44. TipPanel.prototype.PlayAction = function () {
  45. var _this = this;
  46. var cb = cc.callFunc(function () {
  47. _this.closeView();
  48. });
  49. var actions = cc.sequence(cc.moveTo(1, cc.v2(0, 100)), cc.fadeOut(1), cb);
  50. this.node.runAction(actions);
  51. };
  52. TipPanel.path = function () {
  53. return "/prefabs/TipPanel";
  54. };
  55. TipPanel = __decorate([
  56. ccclass
  57. ], TipPanel);
  58. return TipPanel;
  59. }(BaseView_1.BaseView));
  60. exports.default = TipPanel;
  61. cc._RF.pop();