@safe-engine/cocos 2.6.5 → 2.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +124 -2
  2. package/dist/core/NodeComp.d.ts +4 -1
  3. package/dist/core/NodeComp.d.ts.map +1 -1
  4. package/dist/core/NodeComp.js +12 -1
  5. package/dist/core/decorator.d.ts +1 -0
  6. package/dist/core/decorator.d.ts.map +1 -1
  7. package/dist/core/decorator.js +3 -0
  8. package/dist/dragonbones/db-cocos/SimpleMeshNode.d.ts +1 -1
  9. package/dist/dragonbones/db-cocos/SimpleMeshNode.d.ts.map +1 -1
  10. package/dist/gui/GUIComponent.d.ts +1 -0
  11. package/dist/gui/GUIComponent.d.ts.map +1 -1
  12. package/dist/gui/GUISystem.d.ts.map +1 -1
  13. package/dist/gui/GUISystem.js +13 -5
  14. package/dist/gui/SliderComp.d.ts +16 -0
  15. package/dist/gui/SliderComp.d.ts.map +1 -0
  16. package/dist/gui/SliderComp.js +32 -0
  17. package/dist/polyfills.d.ts +20 -0
  18. package/dist/polyfills.d.ts.map +1 -1
  19. package/dist/polyfills.js +9 -0
  20. package/dist/render/RenderComponent.d.ts +1 -0
  21. package/dist/render/RenderComponent.d.ts.map +1 -1
  22. package/dist/render/RenderComponent.js +3 -0
  23. package/dist/render/RenderTextureComp.d.ts +10 -0
  24. package/dist/render/RenderTextureComp.d.ts.map +1 -0
  25. package/dist/render/RenderTextureComp.js +13 -0
  26. package/dist/richtext/RichTextComp.d.ts +1 -0
  27. package/dist/richtext/RichTextComp.d.ts.map +1 -1
  28. package/dist/richtext/RichTextSystem.js +4 -4
  29. package/package.json +3 -3
  30. package/dist/dragonbones/PixiDragonBonesSprite.d.ts +0 -19
  31. package/dist/dragonbones/PixiDragonBonesSprite.d.ts.map +0 -1
  32. package/dist/dragonbones/PixiDragonBonesSprite.js +0 -75
  33. package/dist/gworld/components/AnimationComponent.d.ts +0 -65
  34. package/dist/gworld/components/AnimationComponent.d.ts.map +0 -1
  35. package/dist/gworld/components/AnimationComponent.js +0 -141
  36. package/dist/gworld/components/CollideComponent.d.ts +0 -64
  37. package/dist/gworld/components/CollideComponent.d.ts.map +0 -1
  38. package/dist/gworld/components/CollideComponent.js +0 -269
  39. package/dist/gworld/components/EnhancedComponent.d.ts +0 -22
  40. package/dist/gworld/components/EnhancedComponent.d.ts.map +0 -1
  41. package/dist/gworld/components/EnhancedComponent.js +0 -51
  42. package/dist/gworld/components/GUIComponent.d.ts +0 -67
  43. package/dist/gworld/components/GUIComponent.d.ts.map +0 -1
  44. package/dist/gworld/components/GUIComponent.js +0 -166
  45. package/dist/gworld/components/NoRenderComponent.d.ts +0 -38
  46. package/dist/gworld/components/NoRenderComponent.d.ts.map +0 -1
  47. package/dist/gworld/components/NoRenderComponent.js +0 -81
  48. package/dist/gworld/components/NodeComp.d.ts +0 -152
  49. package/dist/gworld/components/NodeComp.d.ts.map +0 -1
  50. package/dist/gworld/components/NodeComp.js +0 -405
  51. package/dist/gworld/components/RenderComponent.d.ts +0 -58
  52. package/dist/gworld/components/RenderComponent.d.ts.map +0 -1
  53. package/dist/gworld/components/RenderComponent.js +0 -166
  54. package/dist/gworld/core/NodePool.d.ts +0 -9
  55. package/dist/gworld/core/NodePool.d.ts.map +0 -1
  56. package/dist/gworld/core/NodePool.js +0 -30
  57. package/dist/gworld/core/Scene.d.ts +0 -5
  58. package/dist/gworld/core/Scene.d.ts.map +0 -1
  59. package/dist/gworld/core/Scene.js +0 -38
  60. package/dist/gworld/core/decorator.d.ts +0 -9
  61. package/dist/gworld/core/decorator.d.ts.map +0 -1
  62. package/dist/gworld/core/decorator.js +0 -43
  63. package/dist/gworld/index.d.ts +0 -8
  64. package/dist/gworld/index.d.ts.map +0 -1
  65. package/dist/gworld/index.js +0 -43
  66. package/dist/gworld/systems/AnimationSystem.d.ts +0 -6
  67. package/dist/gworld/systems/AnimationSystem.d.ts.map +0 -1
  68. package/dist/gworld/systems/AnimationSystem.js +0 -30
  69. package/dist/gworld/systems/CollideSystem.d.ts +0 -20
  70. package/dist/gworld/systems/CollideSystem.d.ts.map +0 -1
  71. package/dist/gworld/systems/CollideSystem.js +0 -171
  72. package/dist/gworld/systems/GUISystem.d.ts +0 -15
  73. package/dist/gworld/systems/GUISystem.d.ts.map +0 -1
  74. package/dist/gworld/systems/GUISystem.js +0 -123
  75. package/dist/gworld/systems/NoRenderSystem.d.ts +0 -16
  76. package/dist/gworld/systems/NoRenderSystem.d.ts.map +0 -1
  77. package/dist/gworld/systems/NoRenderSystem.js +0 -85
  78. package/dist/gworld/systems/RenderSystem.d.ts +0 -22
  79. package/dist/gworld/systems/RenderSystem.d.ts.map +0 -1
  80. package/dist/gworld/systems/RenderSystem.js +0 -104
  81. package/dist/helper/NodePool.d.ts +0 -9
  82. package/dist/helper/NodePool.d.ts.map +0 -1
  83. package/dist/helper/NodePool.js +0 -29
  84. package/dist/helper/html-text-parser.d.ts +0 -30
  85. package/dist/helper/html-text-parser.d.ts.map +0 -1
  86. package/dist/helper/html-text-parser.js +0 -354
  87. package/dist/safex.d.ts +0 -10
  88. package/dist/safex.d.ts.map +0 -1
  89. package/dist/safex.js +0 -25
  90. package/dist/spine/CCSkeleton.d.ts +0 -2
  91. package/dist/spine/CCSkeleton.d.ts.map +0 -1
  92. package/dist/spine/CCSkeleton.js +0 -344
  93. package/dist/spine/CCSkeletonAnimation.d.ts +0 -16
  94. package/dist/spine/CCSkeletonAnimation.d.ts.map +0 -1
  95. package/dist/spine/CCSkeletonAnimation.js +0 -317
  96. package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts +0 -2
  97. package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts.map +0 -1
  98. package/dist/spine/CCSkeletonCanvasRenderCmd.js +0 -225
  99. package/dist/spine/CCSkeletonTexture.d.ts +0 -2
  100. package/dist/spine/CCSkeletonTexture.d.ts.map +0 -1
  101. package/dist/spine/CCSkeletonTexture.js +0 -62
  102. package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts +0 -2
  103. package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts.map +0 -1
  104. package/dist/spine/CCSkeletonWebGLRenderCmd.js +0 -281
  105. package/dist/spine/PixiSpineSprite.d.ts +0 -19
  106. package/dist/spine/PixiSpineSprite.d.ts.map +0 -1
  107. package/dist/spine/PixiSpineSprite.js +0 -72
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EnhancedComponent = void 0;
4
- var EnhancedComponent = /** @class */ (function () {
5
- function EnhancedComponent(data) {
6
- this.props = {};
7
- this.enabled = true;
8
- this.init(data);
9
- }
10
- EnhancedComponent.prototype.init = function (data) {
11
- var _this = this;
12
- if (data) {
13
- // console.log('constructor', this.constructor.name, data)
14
- Object.keys(data).forEach(function (key) {
15
- _this.props[key] = data[key];
16
- });
17
- }
18
- };
19
- EnhancedComponent.prototype.addComponent = function (instance) {
20
- return this.node.addComponent(instance);
21
- };
22
- EnhancedComponent.prototype.getComponent = function (component) {
23
- return this.node.getComponent(component);
24
- };
25
- EnhancedComponent.prototype.schedule = function (callback, interval, repeat, delay) {
26
- if (repeat === void 0) { repeat = cc.macro.REPEAT_FOREVER; }
27
- if (delay === void 0) { delay = 0; }
28
- this.node.instance.schedule(callback.bind(this), interval, repeat, delay);
29
- };
30
- EnhancedComponent.prototype.unschedule = function (callback) {
31
- this.node.instance.unschedule(callback.bind(this));
32
- };
33
- EnhancedComponent.prototype.unscheduleAllCallbacks = function () {
34
- this.node.instance.unscheduleAllCallbacks();
35
- };
36
- EnhancedComponent.prototype.scheduleOnce = function (callback, delay, key) {
37
- this.node.instance.scheduleOnce(callback, delay, key);
38
- };
39
- EnhancedComponent.prototype.getComponentsInChildren = function (component) {
40
- return this.node.getComponentsInChildren(component);
41
- };
42
- EnhancedComponent.prototype.getComponentInChildren = function (component) {
43
- return this.node.getComponentInChildren(component);
44
- };
45
- EnhancedComponent.prototype.isEqual = function (other) {
46
- return this.node.entity.id === other.node.entity.id;
47
- };
48
- EnhancedComponent.hasRender = true;
49
- return EnhancedComponent;
50
- }());
51
- exports.EnhancedComponent = EnhancedComponent;
@@ -1,67 +0,0 @@
1
- import { BaseComponentProps, LabelCompProps, LabelOutlineCompProps, LabelShadowCompProps, ProgressTimerProps } from '../../../@types/safex';
2
- import { Color4B, Size, Vec2 } from '../../polyfills';
3
- import { ComponentX, NoRenderComponentX } from '../core/decorator';
4
- export declare const FillType: {
5
- HORIZONTAL: number;
6
- VERTICAL: number;
7
- RADIAL: number;
8
- };
9
- type Keys = keyof typeof FillType;
10
- type Values = (typeof FillType)[Keys];
11
- interface ButtonCompProps {
12
- normalImage?: string;
13
- selectedImage?: string;
14
- disableImage?: string;
15
- zoomScale?: number;
16
- onPress?: (target: ButtonComp) => void;
17
- }
18
- export declare class ButtonComp extends NoRenderComponentX<ButtonCompProps> {
19
- texType: ccui.Widget.TextureType;
20
- clickEvents: any[];
21
- setOnPress(cb: (target: ButtonComp) => void): void;
22
- }
23
- export declare class ProgressTimerComp extends ComponentX<ProgressTimerProps & BaseComponentProps<ProgressTimerComp>, cc.ProgressTimer & cc.Node> {
24
- spriteFrame: string;
25
- fillType: Values;
26
- fillRange: number;
27
- fillCenter: Vec2;
28
- isReverse: boolean;
29
- getFillRange(): number;
30
- setFillStart(val: number): void;
31
- setFillRange(val: number): void;
32
- }
33
- export declare class LabelComp extends ComponentX<LabelCompProps & BaseComponentProps<LabelComp>, ccui.Text> {
34
- getString(): string;
35
- setString(val: string): void;
36
- }
37
- export declare class RichTextComp extends ComponentX<LabelCompProps & BaseComponentProps<RichTextComp>, ccui.RichText> {
38
- get string(): string;
39
- set string(val: string);
40
- }
41
- export declare class LabelOutlineComp extends NoRenderComponentX<LabelOutlineCompProps> {
42
- color: typeof Color4B;
43
- width: Float;
44
- }
45
- export declare class LabelShadowComp extends NoRenderComponentX<LabelShadowCompProps> {
46
- color: typeof Color4B;
47
- blur: Float;
48
- offset: Size;
49
- }
50
- export declare enum ScrollViewDirection {
51
- NONE,
52
- HORIZONTAL,
53
- VERTICAL,
54
- BOTH
55
- }
56
- interface ScrollViewProps {
57
- viewSize: Size;
58
- contentSize: Size;
59
- direction?: ScrollViewDirection;
60
- }
61
- export declare class ScrollViewComp extends ComponentX<ScrollViewProps & BaseComponentProps<ScrollViewComp>, cc.ScrollView> {
62
- zoom(scale: number): void;
63
- }
64
- export declare class BlockInputEventsComp extends NoRenderComponentX {
65
- }
66
- export {};
67
- //# sourceMappingURL=GUIComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GUIComponent.d.ts","sourceRoot":"","sources":["../../../src/gworld/components/GUIComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE3I,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAElE,eAAO,MAAM,QAAQ;;;;CAIpB,CAAA;AACD,KAAK,IAAI,GAAG,MAAM,OAAO,QAAQ,CAAA;AACjC,KAAK,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA;AAGrC,UAAU,eAAe;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;CACvC;AACD,qBAAa,UAAW,SAAQ,kBAAkB,CAAC,eAAe,CAAC;IACjE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAA;IAChC,WAAW,QAAK;IAEhB,UAAU,CAAC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E,IAAI,CAAA;IACjB,SAAS,CAAC,EAAE,mBAAmB,CAAA;CAChC;AACD,qBAAa,cAAe,SAAQ,UAAU,CAAC,eAAe,GAAG,kBAAkB,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC;IACjH,IAAI,CAAC,KAAK,EAAE,MAAM;CAKnB;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB;CAAI"}
@@ -1,166 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.BlockInputEventsComp = exports.ScrollViewComp = exports.ScrollViewDirection = exports.LabelShadowComp = exports.LabelOutlineComp = exports.RichTextComp = exports.LabelComp = exports.ProgressTimerComp = exports.ButtonComp = exports.FillType = void 0;
19
- var html_text_parser_1 = require("../../helper/html-text-parser");
20
- var polyfills_1 = require("../../polyfills");
21
- var decorator_1 = require("../core/decorator");
22
- exports.FillType = {
23
- HORIZONTAL: 0,
24
- VERTICAL: 1,
25
- RADIAL: 2,
26
- };
27
- var _htmlTextParser = new html_text_parser_1.HtmlTextParser();
28
- var ButtonComp = /** @class */ (function (_super) {
29
- __extends(ButtonComp, _super);
30
- function ButtonComp() {
31
- var _this = _super !== null && _super.apply(this, arguments) || this;
32
- _this.clickEvents = [];
33
- return _this;
34
- // setTouchEnabled(val) {
35
- // this.node.setTouchEnabled(val)
36
- // }
37
- }
38
- ButtonComp.prototype.setOnPress = function (cb) {
39
- this.props.onPress = cb;
40
- };
41
- return ButtonComp;
42
- }(decorator_1.NoRenderComponentX));
43
- exports.ButtonComp = ButtonComp;
44
- var ProgressTimerComp = /** @class */ (function (_super) {
45
- __extends(ProgressTimerComp, _super);
46
- function ProgressTimerComp() {
47
- return _super !== null && _super.apply(this, arguments) || this;
48
- }
49
- ProgressTimerComp.prototype.getFillRange = function () {
50
- if (this.node.instance instanceof cc.ProgressTimer) {
51
- return this.node.instance.getPercentage() * 0.01;
52
- }
53
- };
54
- ProgressTimerComp.prototype.setFillStart = function (val) {
55
- if (this.node.instance instanceof cc.ProgressTimer) {
56
- this.node.instance.setMidpoint((0, polyfills_1.Vec2)(val, val));
57
- }
58
- };
59
- ProgressTimerComp.prototype.setFillRange = function (val) {
60
- if (this.node.instance instanceof cc.ProgressTimer) {
61
- this.node.instance.setPercentage(val * 100);
62
- }
63
- };
64
- return ProgressTimerComp;
65
- }(decorator_1.ComponentX));
66
- exports.ProgressTimerComp = ProgressTimerComp;
67
- var LabelComp = /** @class */ (function (_super) {
68
- __extends(LabelComp, _super);
69
- function LabelComp() {
70
- return _super !== null && _super.apply(this, arguments) || this;
71
- }
72
- // protected font: string
73
- // protected string: string
74
- // protected size: number
75
- LabelComp.prototype.getString = function () {
76
- return this.props.string;
77
- };
78
- LabelComp.prototype.setString = function (val) {
79
- this.props.string = val;
80
- if (this.node.instance instanceof ccui.Text) {
81
- this.node.instance.setString(val);
82
- }
83
- };
84
- return LabelComp;
85
- }(decorator_1.ComponentX));
86
- exports.LabelComp = LabelComp;
87
- var RichTextComp = /** @class */ (function (_super) {
88
- __extends(RichTextComp, _super);
89
- function RichTextComp() {
90
- return _super !== null && _super.apply(this, arguments) || this;
91
- }
92
- Object.defineProperty(RichTextComp.prototype, "string", {
93
- get: function () {
94
- return this.props.string;
95
- },
96
- set: function (val) {
97
- this.props.string = val;
98
- if (this.node.instance instanceof ccui.RichText) {
99
- var newTextArray = _htmlTextParser.parse(val);
100
- console.log(newTextArray);
101
- this.node.instance._richElements = [];
102
- this.node.instance._formatTextDirty = true;
103
- this.node.instance.formatText();
104
- for (var index = 0; index < newTextArray.length; index++) {
105
- var _a = newTextArray[index], style = _a.style, text = _a.text;
106
- var color = style && style.color ? cc.hexToColor(style.color) : cc.Color.WHITE;
107
- var fontName = cc.path.basename(this.props.font, '.ttf');
108
- var richText = ccui.RichElementText.create(index, color, 255, text, fontName, this.props.size || 64);
109
- // if (style && style.newline) {
110
- // console.log('newline')
111
- // this.node.instance._addNewLine()
112
- // }
113
- this.node.instance.pushBackElement(richText);
114
- }
115
- }
116
- },
117
- enumerable: false,
118
- configurable: true
119
- });
120
- return RichTextComp;
121
- }(decorator_1.ComponentX));
122
- exports.RichTextComp = RichTextComp;
123
- var LabelOutlineComp = /** @class */ (function (_super) {
124
- __extends(LabelOutlineComp, _super);
125
- function LabelOutlineComp() {
126
- return _super !== null && _super.apply(this, arguments) || this;
127
- }
128
- return LabelOutlineComp;
129
- }(decorator_1.NoRenderComponentX));
130
- exports.LabelOutlineComp = LabelOutlineComp;
131
- var LabelShadowComp = /** @class */ (function (_super) {
132
- __extends(LabelShadowComp, _super);
133
- function LabelShadowComp() {
134
- return _super !== null && _super.apply(this, arguments) || this;
135
- }
136
- return LabelShadowComp;
137
- }(decorator_1.NoRenderComponentX));
138
- exports.LabelShadowComp = LabelShadowComp;
139
- var ScrollViewDirection;
140
- (function (ScrollViewDirection) {
141
- ScrollViewDirection[ScrollViewDirection["NONE"] = cc.SCROLLVIEW_DIRECTION_NONE] = "NONE";
142
- ScrollViewDirection[ScrollViewDirection["HORIZONTAL"] = cc.SCROLLVIEW_DIRECTION_HORIZONTAL] = "HORIZONTAL";
143
- ScrollViewDirection[ScrollViewDirection["VERTICAL"] = cc.SCROLLVIEW_DIRECTION_VERTICAL] = "VERTICAL";
144
- ScrollViewDirection[ScrollViewDirection["BOTH"] = cc.SCROLLVIEW_DIRECTION_BOTH] = "BOTH";
145
- })(ScrollViewDirection || (exports.ScrollViewDirection = ScrollViewDirection = {}));
146
- var ScrollViewComp = /** @class */ (function (_super) {
147
- __extends(ScrollViewComp, _super);
148
- function ScrollViewComp() {
149
- return _super !== null && _super.apply(this, arguments) || this;
150
- }
151
- ScrollViewComp.prototype.zoom = function (scale) {
152
- if (this.node.instance instanceof cc.ScrollView) {
153
- this.node.instance.getContainer().setScale(scale);
154
- }
155
- };
156
- return ScrollViewComp;
157
- }(decorator_1.ComponentX));
158
- exports.ScrollViewComp = ScrollViewComp;
159
- var BlockInputEventsComp = /** @class */ (function (_super) {
160
- __extends(BlockInputEventsComp, _super);
161
- function BlockInputEventsComp() {
162
- return _super !== null && _super.apply(this, arguments) || this;
163
- }
164
- return BlockInputEventsComp;
165
- }(decorator_1.NoRenderComponentX));
166
- exports.BlockInputEventsComp = BlockInputEventsComp;
@@ -1,38 +0,0 @@
1
- import { Touch } from '../../polyfills';
2
- import { NoRenderComponentX } from '../core/decorator';
3
- import { EventCallbackType, NodeComp } from './NodeComp';
4
- type TouchEVentCallback = (touch?: Touch, node?: NodeComp) => void;
5
- export interface EventMap {
6
- [key: string]: [EventCallbackType];
7
- }
8
- export declare class EventRegister extends NoRenderComponentX {
9
- events: EventMap;
10
- on(name: string, callback: EventCallbackType, target?: any): void;
11
- off(name: string, callback?: EventCallbackType, target?: any): any;
12
- emit(name: string, ...params: any): void;
13
- }
14
- interface TouchEventProps {
15
- onTouchStart?: TouchEVentCallback;
16
- onTouchMove?: TouchEVentCallback;
17
- onTouchEnd?: TouchEVentCallback;
18
- onTouchCancel?: TouchEVentCallback;
19
- }
20
- export declare class TouchEventRegister extends NoRenderComponentX<TouchEventProps> {
21
- listener: cc.EventListener;
22
- touch: cc.Touch;
23
- setEnabled(enabled: boolean): void;
24
- }
25
- interface ExtraDataProps {
26
- key: string;
27
- value: Integer | Float | string;
28
- }
29
- export declare class ExtraDataComp extends NoRenderComponentX<ExtraDataProps> {
30
- data: {
31
- [key: string]: any;
32
- };
33
- getData<T>(key: string): T;
34
- setData<T>(key: string, val: T): void;
35
- removeData(key: string): void;
36
- }
37
- export {};
38
- //# sourceMappingURL=NoRenderComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NoRenderComponent.d.ts","sourceRoot":"","sources":["../../../src/gworld/components/NoRenderComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAExD,KAAK,kBAAkB,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAA;AAElE,MAAM,WAAW,QAAQ;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,iBAAiB,CAAC,CAAA;CACnC;AAED,qBAAa,aAAc,SAAQ,kBAAkB;IACnD,MAAM,EAAE,QAAQ,CAAK;IAErB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,GAAG;IAS1D,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,GAAG;IAK5D,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG;CAMlC;AAED,UAAU,eAAe;IACvB,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,UAAU,CAAC,EAAE,kBAAkB,CAAA;IAC/B,aAAa,CAAC,EAAE,kBAAkB,CAAA;CACnC;AACD,qBAAa,kBAAmB,SAAQ,kBAAkB,CAAC,eAAe,CAAC;IACzE,QAAQ,EAAE,EAAE,CAAC,aAAa,CAAA;IAC1B,KAAK,EAAE,EAAE,CAAC,KAAK,CAAA;IACf,UAAU,CAAC,OAAO,EAAE,OAAO;CAG5B;AAED,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;CAChC;AACD,qBAAa,aAAc,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACnE,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAK;IACjC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;IAG1B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAG9B,UAAU,CAAC,GAAG,EAAE,MAAM;CAGvB"}
@@ -1,81 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ExtraDataComp = exports.TouchEventRegister = exports.EventRegister = void 0;
19
- var decorator_1 = require("../core/decorator");
20
- var EventRegister = /** @class */ (function (_super) {
21
- __extends(EventRegister, _super);
22
- function EventRegister() {
23
- var _this = _super !== null && _super.apply(this, arguments) || this;
24
- _this.events = {};
25
- return _this;
26
- }
27
- EventRegister.prototype.on = function (name, callback, target) {
28
- var bound = target ? callback.bind(target) : callback;
29
- if (this.events[name]) {
30
- this.events[name].push(bound);
31
- }
32
- else {
33
- this.events[name] = [bound];
34
- }
35
- };
36
- EventRegister.prototype.off = function (name) {
37
- this.events[name] = undefined;
38
- };
39
- EventRegister.prototype.emit = function (name) {
40
- var params = [];
41
- for (var _i = 1; _i < arguments.length; _i++) {
42
- params[_i - 1] = arguments[_i];
43
- }
44
- // if (!this.node || !this.node.active || !this.enabled) return
45
- if (this.events[name]) {
46
- this.events[name].forEach(function (fc) { return fc.apply(void 0, params); });
47
- }
48
- };
49
- return EventRegister;
50
- }(decorator_1.NoRenderComponentX));
51
- exports.EventRegister = EventRegister;
52
- var TouchEventRegister = /** @class */ (function (_super) {
53
- __extends(TouchEventRegister, _super);
54
- function TouchEventRegister() {
55
- return _super !== null && _super.apply(this, arguments) || this;
56
- }
57
- TouchEventRegister.prototype.setEnabled = function (enabled) {
58
- this.listener.setEnabled(enabled);
59
- };
60
- return TouchEventRegister;
61
- }(decorator_1.NoRenderComponentX));
62
- exports.TouchEventRegister = TouchEventRegister;
63
- var ExtraDataComp = /** @class */ (function (_super) {
64
- __extends(ExtraDataComp, _super);
65
- function ExtraDataComp() {
66
- var _this = _super !== null && _super.apply(this, arguments) || this;
67
- _this.data = {};
68
- return _this;
69
- }
70
- ExtraDataComp.prototype.getData = function (key) {
71
- return this.data[key];
72
- };
73
- ExtraDataComp.prototype.setData = function (key, val) {
74
- this.data[key] = val;
75
- };
76
- ExtraDataComp.prototype.removeData = function (key) {
77
- delete this.data[key];
78
- };
79
- return ExtraDataComp;
80
- }(decorator_1.NoRenderComponentX));
81
- exports.ExtraDataComp = ExtraDataComp;
@@ -1,152 +0,0 @@
1
- import { Constructor, Entity } from 'entityx-ts';
2
- import { Vec2 } from '../../polyfills';
3
- import { ComponentType, EnhancedComponent } from './EnhancedComponent';
4
- export type EventCallbackType = (...args: any[]) => void;
5
- export declare class NodeComp<C extends cc.Node = cc.Node> {
6
- entity: Entity;
7
- instance: C;
8
- parent: NodeComp;
9
- children: NodeComp[];
10
- name: string;
11
- _group: any;
12
- _active: boolean;
13
- constructor(instance: C, entity: Entity);
14
- get uuid(): number;
15
- get position(): Readonly<Vec2>;
16
- set position(val: Vec2);
17
- getPositionX(): number;
18
- setPositionX(val: number): void;
19
- getPositionY(): number;
20
- setPositionY(val: number): void;
21
- get scale(): number;
22
- set scale(val: number);
23
- get scaleX(): number;
24
- set scaleX(val: number);
25
- get scaleY(): number;
26
- set scaleY(val: number);
27
- get anchorX(): number;
28
- set anchorX(val: number);
29
- get anchorY(): number;
30
- set anchorY(val: number);
31
- /**
32
- * Returns the angle of the node in degrees. 0 is the default rotation angle. Positive values rotate node clockwise.
33
- * @function
34
- * @return {Number} The rotation of the node in degrees.
35
- */
36
- get rotation(): number;
37
- /**
38
- *
39
- * Sets the X angle of the node in degrees which performs a horizontal rotational skew.
40
- * (support only in WebGL rendering mode)
41
- * 0 is the default rotation angle.
42
- * Positive values rotate node clockwise, and negative values for anti-clockwise.
43
- *
44
- * @param {Number} degrees The X rotation in degrees which performs a horizontal rotational skew.
45
- */
46
- set rotation(val: number);
47
- get color(): cc.Color;
48
- set color(val: cc.Color);
49
- get opacity(): number;
50
- set opacity(val: number);
51
- get active(): boolean;
52
- set active(val: boolean);
53
- get group(): string | number;
54
- set group(val: string | number);
55
- get width(): number;
56
- set width(val: number);
57
- get height(): number;
58
- set height(val: number);
59
- get zIndex(): number;
60
- set zIndex(val: number);
61
- get childrenCount(): number;
62
- destroy(): void;
63
- addComponent<T extends ComponentType>(instance: T): T;
64
- getComponent<T extends ComponentType>(component: Constructor<T>): T;
65
- getComponentsInChildren<T extends ComponentType>(component: Constructor<T>): T[];
66
- getComponentInChildren<T extends ComponentType>(component: Constructor<T>): T;
67
- hasComponentInChildren<T extends ComponentType>(component: Constructor<T>): boolean;
68
- getPercent(): number;
69
- setPercent(val: number): void;
70
- setTouchEnabled(enabled: boolean): void;
71
- addTouchEventListener(cb: any): void;
72
- convertToNodeSpace(point: cc.Point): {
73
- x: number;
74
- y: number;
75
- equals(other: /*elided*/ any): boolean;
76
- add(value: cc.Point | Vec2): /*elided*/ any;
77
- addSelf(value: cc.Point | Vec2): /*elided*/ any;
78
- sub(value: cc.Point | Vec2): /*elided*/ any;
79
- mul(multiply: number): /*elided*/ any;
80
- mulSelf(multiply: number): /*elided*/ any;
81
- mag(): number;
82
- normalizeSelf(): /*elided*/ any;
83
- normalize(): /*elided*/ any;
84
- cross(other: Vec2): number;
85
- signAngle(other: Vec2): number;
86
- lengthSqr(): number;
87
- dot(other: Vec2): number;
88
- angle(other: Vec2): number;
89
- distance(other: /*elided*/ any): number;
90
- };
91
- convertToNodeSpaceAR(point: cc.Point): {
92
- x: number;
93
- y: number;
94
- equals(other: /*elided*/ any): boolean;
95
- add(value: cc.Point | Vec2): /*elided*/ any;
96
- addSelf(value: cc.Point | Vec2): /*elided*/ any;
97
- sub(value: cc.Point | Vec2): /*elided*/ any;
98
- mul(multiply: number): /*elided*/ any;
99
- mulSelf(multiply: number): /*elided*/ any;
100
- mag(): number;
101
- normalizeSelf(): /*elided*/ any;
102
- normalize(): /*elided*/ any;
103
- cross(other: Vec2): number;
104
- signAngle(other: Vec2): number;
105
- lengthSqr(): number;
106
- dot(other: Vec2): number;
107
- angle(other: Vec2): number;
108
- distance(other: /*elided*/ any): number;
109
- };
110
- convertToWorldSpaceAR(point: cc.Vec2): {
111
- x: number;
112
- y: number;
113
- equals(other: /*elided*/ any): boolean;
114
- add(value: cc.Point | Vec2): /*elided*/ any;
115
- addSelf(value: cc.Point | Vec2): /*elided*/ any;
116
- sub(value: cc.Point | Vec2): /*elided*/ any;
117
- mul(multiply: number): /*elided*/ any;
118
- mulSelf(multiply: number): /*elided*/ any;
119
- mag(): number;
120
- normalizeSelf(): /*elided*/ any;
121
- normalize(): /*elided*/ any;
122
- cross(other: Vec2): number;
123
- signAngle(other: Vec2): number;
124
- lengthSqr(): number;
125
- dot(other: Vec2): number;
126
- angle(other: Vec2): number;
127
- distance(other: /*elided*/ any): number;
128
- };
129
- getPosition(): cc.Point;
130
- setPosition(x: number | cc.Vec2 | cc.Vec3 | cc.Point, y?: number): void;
131
- setRotation(deg: number): void;
132
- getRotation(): number;
133
- setAnchorPoint(point: number | cc.Point, y?: number): void;
134
- getAnchorPoint(): cc.Point;
135
- getBoundingBox(): cc.Rect;
136
- getContentSize(): cc.Size;
137
- setContentSize(size: cc.Size | number, height?: number): void;
138
- setColor(color: cc.Color): void;
139
- setScale(scaleX: number, scaleY?: number): void;
140
- runAction(atc: cc.ActionInterval): void;
141
- stopAllActions(): void;
142
- pauseAllActionsAndSchedule(): void;
143
- resumeAllActionsAndSchedule(): void;
144
- removeFromParent(cleanup?: boolean): void;
145
- addChild(child: NodeComp, zOrder?: number, tag?: number): any;
146
- removeAllChildren(cleanup?: any): void;
147
- getData<T>(key: string): T;
148
- setData<T extends Integer | Float | string>(key: string, value: T): void;
149
- removeData(key: string): void;
150
- resolveComponent(component: EnhancedComponent<object, NodeComp>): void;
151
- }
152
- //# sourceMappingURL=NodeComp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NodeComp.d.ts","sourceRoot":"","sources":["../../../src/gworld/components/NodeComp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIhD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,OAAA,KAAK,IAAI,CAAA;AACjD,qBAAa,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,CAAA;IACX,MAAM,EAAE,QAAQ,CAAA;IAChB,QAAQ,EAAE,QAAQ,EAAE,CAAK;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,MAAA;IACN,OAAO,UA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