@safe-engine/cocos 1.9.6 → 1.10.1
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.
- package/dist/app.d.ts +1 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +6 -7
- package/dist/core/NodeComp.d.ts +0 -7
- package/dist/core/NodeComp.d.ts.map +1 -1
- package/dist/core/NodeComp.js +12 -12
- package/dist/gui/GUIComponent.d.ts +6 -31
- package/dist/gui/GUIComponent.d.ts.map +1 -1
- package/dist/gui/GUIComponent.js +3 -22
- package/dist/gui/GUISystem.d.ts +0 -2
- package/dist/gui/GUISystem.d.ts.map +1 -1
- package/dist/gui/GUISystem.js +9 -17
- package/dist/polyfills.d.ts +0 -1
- package/dist/polyfills.d.ts.map +1 -1
- package/dist/polyfills.js +0 -3
- package/dist/spine/CCSkeleton.d.ts +188 -1
- package/dist/spine/CCSkeleton.d.ts.map +1 -1
- package/dist/spine/CCSkeleton.js +103 -127
- package/dist/spine/CCSkeletonAnimation.d.ts +136 -6
- package/dist/spine/CCSkeletonAnimation.d.ts.map +1 -1
- package/dist/spine/CCSkeletonAnimation.js +95 -101
- package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts.map +1 -1
- package/dist/spine/CCSkeletonCanvasRenderCmd.js +6 -3
- package/dist/spine/CCSkeletonTexture.d.ts +24 -1
- package/dist/spine/CCSkeletonTexture.d.ts.map +1 -1
- package/dist/spine/CCSkeletonTexture.js +4 -6
- package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts +27 -1
- package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts.map +1 -1
- package/dist/spine/CCSkeletonWebGLRenderCmd.js +243 -247
- package/dist/spine/index.d.ts +4 -8
- package/dist/spine/index.d.ts.map +1 -1
- package/dist/spine/index.js +5 -11
- package/package.json +1 -1
package/dist/app.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare function startGame(defaultFont: string, { width, height }: {
|
|
|
10
10
|
width: any;
|
|
11
11
|
height: any;
|
|
12
12
|
}, option?: Partial<RunOptions>): Promise<void>;
|
|
13
|
-
export declare function loadAll(assets
|
|
13
|
+
export declare function loadAll(assets?: string[], cb?: (progress: number) => void, onCompleted?: () => void): void;
|
|
14
14
|
export declare function loadJsonFromCache<T>(filePath: string): T;
|
|
15
15
|
export declare const audioEngine: typeof cc.audioEngine;
|
|
16
16
|
export {};
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAMA,wBAAgB,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,QAc7C;AACD,UAAU,UAAU;IAClB,SAAS,EAAE,CAAC,GAAG,CAAC,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CACtB;AACD,wBAAsB,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;;;CAAA,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAMA,wBAAgB,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,QAc7C;AACD,UAAU,UAAU;IAClB,SAAS,EAAE,CAAC,GAAG,CAAC,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CACtB;AACD,wBAAsB,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;;;CAAA,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,iBA2CnG;AAED,wBAAgB,OAAO,CAAC,MAAM,GAAE,MAAM,EAAO,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,IAAI,QA0BvG;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,CAIxD;AAED,eAAO,MAAM,WAAW,uBAAiB,CAAA"}
|
package/dist/app.js
CHANGED
|
@@ -41,8 +41,8 @@ export async function startGame(defaultFont, { width, height }, option) {
|
|
|
41
41
|
showFPS: false,
|
|
42
42
|
frameRate: 60,
|
|
43
43
|
id: 'gameCanvas',
|
|
44
|
-
renderMode:
|
|
45
|
-
...option || {},
|
|
44
|
+
renderMode: 0,
|
|
45
|
+
...(option || {}),
|
|
46
46
|
}, function onStart() {
|
|
47
47
|
// Pass true to enable retina display, disabled by default to improve performance
|
|
48
48
|
cc.view.enableRetina(cc.sys.os === cc.sys.OS_IOS);
|
|
@@ -57,7 +57,7 @@ export async function startGame(defaultFont, { width, height }, option) {
|
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
export function loadAll(assets = [], cb) {
|
|
60
|
+
export function loadAll(assets = [], cb, onCompleted) {
|
|
61
61
|
cc.loader.load(assets.map((value) => {
|
|
62
62
|
if (value.endsWith('.ttf')) {
|
|
63
63
|
return {
|
|
@@ -77,10 +77,9 @@ export function loadAll(assets = [], cb) {
|
|
|
77
77
|
}
|
|
78
78
|
let percent = loadedCount / count;
|
|
79
79
|
percent = Math.min(percent, 1);
|
|
80
|
-
cb
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
});
|
|
80
|
+
if (cb)
|
|
81
|
+
cb(percent);
|
|
82
|
+
}, onCompleted);
|
|
84
83
|
}
|
|
85
84
|
export function loadJsonFromCache(filePath) {
|
|
86
85
|
const res = cc.loader.getRes(filePath);
|
package/dist/core/NodeComp.d.ts
CHANGED
|
@@ -54,10 +54,6 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
|
|
|
54
54
|
set active(val: boolean);
|
|
55
55
|
get group(): string | number;
|
|
56
56
|
set group(val: string | number);
|
|
57
|
-
get width(): number;
|
|
58
|
-
set width(val: number);
|
|
59
|
-
get height(): number;
|
|
60
|
-
set height(val: number);
|
|
61
57
|
get zIndex(): number;
|
|
62
58
|
set zIndex(val: number);
|
|
63
59
|
get childrenCount(): number;
|
|
@@ -87,7 +83,6 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
|
|
|
87
83
|
dot(other: Vec2): number;
|
|
88
84
|
angle(other: Vec2): number;
|
|
89
85
|
distance(other: /*elided*/ any): number;
|
|
90
|
-
clone(): /*elided*/ any;
|
|
91
86
|
};
|
|
92
87
|
convertToNodeSpaceAR(point: cc.Point): {
|
|
93
88
|
x: number;
|
|
@@ -107,7 +102,6 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
|
|
|
107
102
|
dot(other: Vec2): number;
|
|
108
103
|
angle(other: Vec2): number;
|
|
109
104
|
distance(other: /*elided*/ any): number;
|
|
110
|
-
clone(): /*elided*/ any;
|
|
111
105
|
};
|
|
112
106
|
convertToWorldSpaceAR(point: cc.Vec2): {
|
|
113
107
|
x: number;
|
|
@@ -127,7 +121,6 @@ export declare class NodeComp<C extends cc.Node = cc.Node> {
|
|
|
127
121
|
dot(other: Vec2): number;
|
|
128
122
|
angle(other: Vec2): number;
|
|
129
123
|
distance(other: /*elided*/ any): number;
|
|
130
|
-
clone(): /*elided*/ any;
|
|
131
124
|
};
|
|
132
125
|
getBoundingBox(): cc.Rect;
|
|
133
126
|
get contentSize(): Size;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeComp.d.ts","sourceRoot":"","sources":["../../src/core/NodeComp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAGhD,OAAO,EAAE,aAAa,E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,CAAC,OAAO,CAAC,EAAE,OAAO;IAkBlC,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAQvD,iBAAiB,CAAC,OAAO,CAAC,KAAA;IAM1B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;IAM1B,OAAO,CAAC,CAAC,SAAS,OAAO,GAAG,KAAK,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IASjE,IAAI,KAAK,kBAMR;IAED,UAAU,CAAC,GAAG,EAAE,MAAM;IAOtB,gBAAgB,CAAC,SAAS,EAAE,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC;CAOhE"}
|
package/dist/core/NodeComp.js
CHANGED
|
@@ -126,18 +126,18 @@ export class NodeComp {
|
|
|
126
126
|
set group(val) {
|
|
127
127
|
this._group = val;
|
|
128
128
|
}
|
|
129
|
-
get width() {
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
set width(val) {
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
get height() {
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
set height(val) {
|
|
139
|
-
|
|
140
|
-
}
|
|
129
|
+
// get width() {
|
|
130
|
+
// return this.instance.width
|
|
131
|
+
// }
|
|
132
|
+
// set width(val) {
|
|
133
|
+
// this.instance.setContentSize(val, this.height)
|
|
134
|
+
// }
|
|
135
|
+
// get height() {
|
|
136
|
+
// return this.instance.height
|
|
137
|
+
// }
|
|
138
|
+
// set height(val) {
|
|
139
|
+
// this.instance.setContentSize(this.width, val)
|
|
140
|
+
// }
|
|
141
141
|
get zIndex() {
|
|
142
142
|
return this.instance.zIndex;
|
|
143
143
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { ComponentX, NoRenderComponentX } from '../core/decorator';
|
|
2
|
-
import {
|
|
2
|
+
import { Size, Vec2 } from '../polyfills';
|
|
3
3
|
import { BaseComponentProps, ColorSource } from '../safex';
|
|
4
4
|
export declare const FillType: {
|
|
5
5
|
HORIZONTAL: number;
|
|
6
6
|
VERTICAL: number;
|
|
7
7
|
RADIAL: number;
|
|
8
8
|
};
|
|
9
|
-
type Keys = keyof typeof FillType;
|
|
10
|
-
type Values = (typeof FillType)[Keys];
|
|
11
9
|
interface ButtonCompProps {
|
|
12
10
|
normalImage?: string;
|
|
13
11
|
selectedImage?: string;
|
|
@@ -16,8 +14,6 @@ interface ButtonCompProps {
|
|
|
16
14
|
onPress?: (target: ButtonComp) => void;
|
|
17
15
|
}
|
|
18
16
|
export declare class ButtonComp extends NoRenderComponentX<ButtonCompProps> {
|
|
19
|
-
clickEvents: any[];
|
|
20
|
-
setOnPress(cb: (target: ButtonComp) => void): void;
|
|
21
17
|
}
|
|
22
18
|
interface ProgressTimerProps {
|
|
23
19
|
spriteFrame: string;
|
|
@@ -27,42 +23,21 @@ interface ProgressTimerProps {
|
|
|
27
23
|
isReverse?: boolean;
|
|
28
24
|
}
|
|
29
25
|
export declare class ProgressTimerComp extends ComponentX<ProgressTimerProps & BaseComponentProps<ProgressTimerComp>, cc.ProgressTimer & cc.Node> {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
fillRange: number;
|
|
33
|
-
fillCenter: Vec2;
|
|
34
|
-
isReverse: boolean;
|
|
35
|
-
getFillRange(): number;
|
|
36
|
-
setFillStart(val: number): void;
|
|
37
|
-
setFillRange(val: number): void;
|
|
26
|
+
get fillRange(): number;
|
|
27
|
+
set fillStart(val: number);
|
|
28
|
+
set fillRange(val: number);
|
|
38
29
|
}
|
|
39
30
|
interface LabelCompProps {
|
|
40
31
|
font?: string;
|
|
41
32
|
string?: string;
|
|
42
33
|
size?: number;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
color: ColorSource;
|
|
46
|
-
width: number;
|
|
47
|
-
}
|
|
48
|
-
interface LabelShadowCompProps {
|
|
49
|
-
color: ColorSource;
|
|
50
|
-
blur: number;
|
|
51
|
-
offset: Vec2;
|
|
34
|
+
outline?: [ColorSource, number];
|
|
35
|
+
shadow?: [ColorSource, number, Size];
|
|
52
36
|
}
|
|
53
37
|
export declare class LabelComp extends ComponentX<LabelCompProps & BaseComponentProps<LabelComp>, ccui.Text> {
|
|
54
38
|
get string(): string;
|
|
55
39
|
set string(val: string);
|
|
56
40
|
}
|
|
57
|
-
export declare class LabelOutlineComp extends NoRenderComponentX<LabelOutlineCompProps> {
|
|
58
|
-
color: typeof Color4B;
|
|
59
|
-
width: Float;
|
|
60
|
-
}
|
|
61
|
-
export declare class LabelShadowComp extends NoRenderComponentX<LabelShadowCompProps> {
|
|
62
|
-
color: typeof Color4B;
|
|
63
|
-
blur: Float;
|
|
64
|
-
offset: Size;
|
|
65
|
-
}
|
|
66
41
|
export declare enum ScrollViewDirection {
|
|
67
42
|
NONE,
|
|
68
43
|
HORIZONTAL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUIComponent.d.ts","sourceRoot":"","sources":["../../src/gui/GUIComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GUIComponent.d.ts","sourceRoot":"","sources":["../../src/gui/GUIComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE1D,eAAO,MAAM,QAAQ;;;;CAIpB,CAAA;AAID,UAAU,eAAe;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,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AAA;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,UAAU,cAAc;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AACD,qBAAa,SAAU,SAAQ,UAAU,CAAC,cAAc,GAAG,kBAAkB,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC;IACvG,IAAI,MAAM,WAET;CACF;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB;CAAG"}
|
package/dist/gui/GUIComponent.js
CHANGED
|
@@ -6,29 +6,19 @@ export const FillType = {
|
|
|
6
6
|
RADIAL: 2,
|
|
7
7
|
};
|
|
8
8
|
export class ButtonComp extends NoRenderComponentX {
|
|
9
|
-
// texType: ccui.Widget.TextureType
|
|
10
|
-
clickEvents = [];
|
|
11
|
-
setOnPress(cb) {
|
|
12
|
-
this.props.onPress = cb;
|
|
13
|
-
}
|
|
14
9
|
}
|
|
15
10
|
export class ProgressTimerComp extends ComponentX {
|
|
16
|
-
|
|
17
|
-
fillType;
|
|
18
|
-
fillRange;
|
|
19
|
-
fillCenter;
|
|
20
|
-
isReverse;
|
|
21
|
-
getFillRange() {
|
|
11
|
+
get fillRange() {
|
|
22
12
|
if (this.node.instance instanceof cc.ProgressTimer) {
|
|
23
13
|
return this.node.instance.getPercentage() * 0.01;
|
|
24
14
|
}
|
|
25
15
|
}
|
|
26
|
-
|
|
16
|
+
set fillStart(val) {
|
|
27
17
|
if (this.node.instance instanceof cc.ProgressTimer) {
|
|
28
18
|
this.node.instance.setMidpoint(Vec2(val, val));
|
|
29
19
|
}
|
|
30
20
|
}
|
|
31
|
-
|
|
21
|
+
set fillRange(val) {
|
|
32
22
|
if (this.node.instance instanceof cc.ProgressTimer) {
|
|
33
23
|
this.node.instance.setPercentage(val * 100);
|
|
34
24
|
}
|
|
@@ -45,15 +35,6 @@ export class LabelComp extends ComponentX {
|
|
|
45
35
|
}
|
|
46
36
|
}
|
|
47
37
|
}
|
|
48
|
-
export class LabelOutlineComp extends NoRenderComponentX {
|
|
49
|
-
color;
|
|
50
|
-
width;
|
|
51
|
-
}
|
|
52
|
-
export class LabelShadowComp extends NoRenderComponentX {
|
|
53
|
-
color;
|
|
54
|
-
blur;
|
|
55
|
-
offset;
|
|
56
|
-
}
|
|
57
38
|
export var ScrollViewDirection;
|
|
58
39
|
(function (ScrollViewDirection) {
|
|
59
40
|
ScrollViewDirection[ScrollViewDirection["NONE"] = cc.SCROLLVIEW_DIRECTION_NONE] = "NONE";
|
package/dist/gui/GUISystem.d.ts
CHANGED
|
@@ -5,8 +5,6 @@ export declare class GUISystem implements System {
|
|
|
5
5
|
private onAddButtonComp;
|
|
6
6
|
private onAddProgressTimerComp;
|
|
7
7
|
private onAddLabelComp;
|
|
8
|
-
private onAddLabelOutlineComp;
|
|
9
|
-
private onAddLabelShadowComp;
|
|
10
8
|
private onAddScrollViewComp;
|
|
11
9
|
private onAddBlockInputEventsComp;
|
|
12
10
|
private onAddInputComp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/gui/GUISystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAoC,MAAM,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/gui/GUISystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAoC,MAAM,EAAE,MAAM,YAAY,CAAA;AAMlG,qBAAa,SAAU,YAAW,MAAM;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,aAAa,EAAE,YAAY;IASrC,OAAO,CAAC,eAAe,CAuBtB;IAED,OAAO,CAAC,sBAAsB,CAc7B;IAED,OAAO,CAAC,cAAc,CAcrB;IAED,OAAO,CAAC,mBAAmB,CAU1B;IAED,OAAO,CAAC,yBAAyB,CAOhC;IAED,OAAO,CAAC,cAAc,CAWrB;IAED,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM;CAIjE"}
|
package/dist/gui/GUISystem.js
CHANGED
|
@@ -2,15 +2,13 @@ import { EventTypes } from 'entityx-ts';
|
|
|
2
2
|
import { NodeComp } from '../core/NodeComp';
|
|
3
3
|
import { TouchEventRegister } from '../norender';
|
|
4
4
|
import { Vec2 } from '../polyfills';
|
|
5
|
-
import { BlockInputEventsComp, ButtonComp, FillType, InputComp, LabelComp,
|
|
5
|
+
import { BlockInputEventsComp, ButtonComp, FillType, InputComp, LabelComp, ProgressTimerComp, ScrollViewComp } from './GUIComponent';
|
|
6
6
|
export class GUISystem {
|
|
7
7
|
defaultFont;
|
|
8
8
|
configure(event_manager) {
|
|
9
9
|
event_manager.subscribe(EventTypes.ComponentAdded, ButtonComp, this.onAddButtonComp);
|
|
10
10
|
event_manager.subscribe(EventTypes.ComponentAdded, ProgressTimerComp, this.onAddProgressTimerComp);
|
|
11
11
|
event_manager.subscribe(EventTypes.ComponentAdded, LabelComp, this.onAddLabelComp);
|
|
12
|
-
event_manager.subscribe(EventTypes.ComponentAdded, LabelOutlineComp, this.onAddLabelOutlineComp);
|
|
13
|
-
event_manager.subscribe(EventTypes.ComponentAdded, LabelShadowComp, this.onAddLabelShadowComp);
|
|
14
12
|
event_manager.subscribe(EventTypes.ComponentAdded, ScrollViewComp, this.onAddScrollViewComp);
|
|
15
13
|
event_manager.subscribe(EventTypes.ComponentAdded, InputComp, this.onAddInputComp);
|
|
16
14
|
event_manager.subscribe(EventTypes.ComponentAdded, BlockInputEventsComp, this.onAddBlockInputEventsComp);
|
|
@@ -55,25 +53,19 @@ export class GUISystem {
|
|
|
55
53
|
bar.node = entity.assign(new NodeComp(pTimer, entity));
|
|
56
54
|
};
|
|
57
55
|
onAddLabelComp = ({ entity, component: label }) => {
|
|
58
|
-
const { string = '', font = this.defaultFont, size = 64 } = label.props;
|
|
56
|
+
const { string = '', font = this.defaultFont, size = 64, outline, shadow } = label.props;
|
|
59
57
|
const fontName = cc.path.basename(font, '.ttf');
|
|
60
58
|
const node = new ccui.Text(string, fontName, size);
|
|
61
59
|
node.setTextVerticalAlignment(cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const { color, width } = outline.props;
|
|
66
|
-
const node = entity.getComponent(NodeComp);
|
|
67
|
-
if (node.instance instanceof ccui.Text) {
|
|
68
|
-
node.instance.enableOutline(color, width);
|
|
60
|
+
if (outline) {
|
|
61
|
+
const [color, width] = outline;
|
|
62
|
+
node.enableOutline(color, width);
|
|
69
63
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const node = entity.getComponent(NodeComp);
|
|
74
|
-
if (node.instance instanceof ccui.Text) {
|
|
75
|
-
node.instance.enableShadow(color, offset, blur);
|
|
64
|
+
if (shadow) {
|
|
65
|
+
const [color, blur, offset] = shadow;
|
|
66
|
+
node.enableShadow(color, offset, blur);
|
|
76
67
|
}
|
|
68
|
+
label.node = entity.assign(new NodeComp(node, entity));
|
|
77
69
|
};
|
|
78
70
|
onAddScrollViewComp = ({ entity, component: scrollView }) => {
|
|
79
71
|
const { viewSize, contentSize, direction = cc.SCROLLVIEW_DIRECTION_VERTICAL } = scrollView.props;
|
package/dist/polyfills.d.ts
CHANGED
package/dist/polyfills.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyfills.d.ts","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AAA;gBACC,KAAK,SAAI,EAAE,MAAM,SAAI;CAWlC;AAED,MAAM,MAAM,IAAI,GAAG,KAAK,CAAA;AACxB,wBAAgB,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAEjD;AAED,qBAAa,KAAM,SAAQ,EAAE,CAAC,KAAK;IACzB,WAAW,EAAE,MAAM,IAAI,CAAA;CAChC;AAED,wBAAgB,UAAU,IAAI,IAAI,CAEjC"}
|
package/dist/polyfills.js
CHANGED
|
@@ -1,2 +1,189 @@
|
|
|
1
|
-
|
|
1
|
+
/****************************************************************************
|
|
2
|
+
Copyright (c) 2011-2012 cocos2d-x.org
|
|
3
|
+
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
|
4
|
+
Copyright (c) 2014 Shengxiang Chen (Nero Chan)
|
|
5
|
+
|
|
6
|
+
http://www.cocos2d-x.org
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
|
16
|
+
all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
+
THE SOFTWARE.
|
|
25
|
+
****************************************************************************/
|
|
26
|
+
/**
|
|
27
|
+
* The main namespace of Spine, all classes, functions, properties and constants of Spine are defined in this namespace
|
|
28
|
+
* @namespace
|
|
29
|
+
* @name
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* <p>
|
|
33
|
+
* The skeleton of Spine. <br/>
|
|
34
|
+
* Skeleton has a reference to a SkeletonData and stores the state for skeleton instance,
|
|
35
|
+
* which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible. <br/>
|
|
36
|
+
* Multiple skeletons can use the same SkeletonData (which includes all animations, skins, and attachments). <br/>
|
|
37
|
+
* </p>
|
|
38
|
+
* @class
|
|
39
|
+
* @extends cc.Node
|
|
40
|
+
*/
|
|
41
|
+
export declare class Skeleton extends cc.Node {
|
|
42
|
+
_skeleton: any;
|
|
43
|
+
_rootBone: any;
|
|
44
|
+
_timeScale: number;
|
|
45
|
+
_debugSlots: boolean;
|
|
46
|
+
_debugBones: boolean;
|
|
47
|
+
_premultipliedAlpha: any;
|
|
48
|
+
_ownsSkeletonData: any;
|
|
49
|
+
_atlas: any;
|
|
50
|
+
constructor(skeletonDataFile?: string, atlasFile?: string, scale?: number);
|
|
51
|
+
_createRenderCmd(): any;
|
|
52
|
+
onEnter(): void;
|
|
53
|
+
onExit(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Sets whether open debug slots.
|
|
56
|
+
* @param {boolean} enable true to open, false to close.
|
|
57
|
+
*/
|
|
58
|
+
setDebugSolots(enable: boolean): void;
|
|
59
|
+
/**
|
|
60
|
+
* Sets whether open debug bones.
|
|
61
|
+
* @param {boolean} enable
|
|
62
|
+
*/
|
|
63
|
+
setDebugBones(enable: boolean): void;
|
|
64
|
+
/**
|
|
65
|
+
* Sets whether open debug slots.
|
|
66
|
+
* @param {boolean} enabled true to open, false to close.
|
|
67
|
+
*/
|
|
68
|
+
setDebugSlotsEnabled(enabled: boolean): void;
|
|
69
|
+
/**
|
|
70
|
+
* Gets whether open debug slots.
|
|
71
|
+
* @returns {boolean} true to open, false to close.
|
|
72
|
+
*/
|
|
73
|
+
getDebugSlotsEnabled(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Sets whether open debug bones.
|
|
76
|
+
* @param {boolean} enabled
|
|
77
|
+
*/
|
|
78
|
+
setDebugBonesEnabled(enabled: boolean): void;
|
|
79
|
+
/**
|
|
80
|
+
* Gets whether open debug bones.
|
|
81
|
+
* @returns {boolean} true to open, false to close.
|
|
82
|
+
*/
|
|
83
|
+
getDebugBonesEnabled(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the time scale of Skeleton.
|
|
86
|
+
* @param {Number} scale
|
|
87
|
+
*/
|
|
88
|
+
setTimeScale(scale: number): void;
|
|
89
|
+
getTimeScale(): number;
|
|
90
|
+
/**
|
|
91
|
+
* Initializes Skeleton with Data.
|
|
92
|
+
* @param {.spine.SkeletonData|String} skeletonDataFile
|
|
93
|
+
* @param {String|spine.Atlas|spine.SkeletonData} atlasFile atlas filename or atlas data or owns SkeletonData
|
|
94
|
+
* @param {Number} [scale] scale can be specified on the JSON or binary loader which will scale the bone positions, image sizes, and animation translations.
|
|
95
|
+
*/
|
|
96
|
+
initWithArgs(skeletonDataFile: string, atlasFile: string, scale?: number): void;
|
|
97
|
+
/**
|
|
98
|
+
* Returns the bounding box of Skeleton.
|
|
99
|
+
* @returns {cc.Rect}
|
|
100
|
+
*/
|
|
101
|
+
getBoundingBox(): cc.Rect;
|
|
102
|
+
/**
|
|
103
|
+
* Computes the world SRT from the local SRT for each bone.
|
|
104
|
+
*/
|
|
105
|
+
updateWorldTransform(): void;
|
|
106
|
+
/**
|
|
107
|
+
* Sets the bones and slots to the setup pose.
|
|
108
|
+
*/
|
|
109
|
+
setToSetupPose(): void;
|
|
110
|
+
/**
|
|
111
|
+
* Sets the bones to the setup pose, using the values from the `BoneData` list in the `SkeletonData`.
|
|
112
|
+
*/
|
|
113
|
+
setBonesToSetupPose(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Sets the slots to the setup pose, using the values from the `SlotData` list in the `SkeletonData`.
|
|
116
|
+
*/
|
|
117
|
+
setSlotsToSetupPose(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Finds a bone by name. This does a string comparison for every bone.
|
|
120
|
+
* @param {String} boneName
|
|
121
|
+
* @returns {.spine.Bone}
|
|
122
|
+
*/
|
|
123
|
+
findBone(boneName: string): any;
|
|
124
|
+
/**
|
|
125
|
+
* Finds a slot by name. This does a string comparison for every slot.
|
|
126
|
+
* @param {String} slotName
|
|
127
|
+
* @returns {.spine.Slot}
|
|
128
|
+
*/
|
|
129
|
+
findSlot(slotName: string): any;
|
|
130
|
+
/**
|
|
131
|
+
* Finds a skin by name and makes it the active skin. This does a string comparison for every skin. Note that setting the skin does not change which attachments are visible.
|
|
132
|
+
* @param {string} skinName
|
|
133
|
+
* @returns {.spine.Skin}
|
|
134
|
+
*/
|
|
135
|
+
setSkin(skinName: string): any;
|
|
136
|
+
/**
|
|
137
|
+
* Returns the attachment for the slot and attachment name. The skeleton looks first in its skin, then in the skeleton data’s default skin.
|
|
138
|
+
* @param {String} slotName
|
|
139
|
+
* @param {String} attachmentName
|
|
140
|
+
* @returns {.spine.Attachment}
|
|
141
|
+
*/
|
|
142
|
+
getAttachment(slotName: string, attachmentName: string): any;
|
|
143
|
+
/**
|
|
144
|
+
* Sets the attachment for the slot and attachment name. The skeleton looks first in its skin, then in the skeleton data’s default skin.
|
|
145
|
+
* @param {String} slotName
|
|
146
|
+
* @param {String} attachmentName
|
|
147
|
+
*/
|
|
148
|
+
setAttachment(slotName: string, attachmentName: string): void;
|
|
149
|
+
/**
|
|
150
|
+
* Sets the premultiplied alpha value to Skeleton.
|
|
151
|
+
* @param {Number} alpha
|
|
152
|
+
*/
|
|
153
|
+
setPremultipliedAlpha(premultiplied: boolean): void;
|
|
154
|
+
/**
|
|
155
|
+
* Returns whether to enable premultiplied alpha.
|
|
156
|
+
* @returns {boolean}
|
|
157
|
+
*/
|
|
158
|
+
isPremultipliedAlpha(): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Sets skeleton data to Skeleton.
|
|
161
|
+
* @param {.spine.SkeletonData} skeletonData
|
|
162
|
+
* @param {.spine.SkeletonData} ownsSkeletonData
|
|
163
|
+
*/
|
|
164
|
+
setSkeletonData(skeletonData: any, ownsSkeletonData: any): void;
|
|
165
|
+
/**
|
|
166
|
+
* Return the renderer of attachment.
|
|
167
|
+
* @param {.spine.RegionAttachment|.spine.BoundingBoxAttachment} regionAttachment
|
|
168
|
+
* @returns {.spine.TextureAtlasRegion}
|
|
169
|
+
*/
|
|
170
|
+
getTextureAtlas(regionAttachment: any): any;
|
|
171
|
+
/**
|
|
172
|
+
* Returns the blendFunc of Skeleton.
|
|
173
|
+
* @returns {cc.BlendFunc}
|
|
174
|
+
*/
|
|
175
|
+
getBlendFunc(): any;
|
|
176
|
+
/**
|
|
177
|
+
* Sets the blendFunc of Skeleton, it won't have any effect for skeleton, skeleton is using slot's data to determine the blend function.
|
|
178
|
+
* @param {cc.BlendFunc|Number} src
|
|
179
|
+
* @param {Number} [dst]
|
|
180
|
+
*/
|
|
181
|
+
setBlendFunc(src: any, dst?: any): any;
|
|
182
|
+
/**
|
|
183
|
+
* Update will be called automatically every frame if "scheduleUpdate" is called when the node is "live".
|
|
184
|
+
* @param {Number} dt Delta time since last update
|
|
185
|
+
*/
|
|
186
|
+
update(dt: number): void;
|
|
187
|
+
static create(skeletonDataFile: string, atlasFile: string, scale?: number): Skeleton;
|
|
188
|
+
}
|
|
2
189
|
//# sourceMappingURL=CCSkeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CCSkeleton.d.ts","sourceRoot":"","sources":["../../src/spine/CCSkeleton.ts"],"names":[],"mapp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