@safe-engine/pixi 8.4.7 → 8.5.4
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/README.md +17 -25
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +0 -23
- package/dist/box2d-wasm/ContactListener.d.ts +1 -1
- package/dist/box2d-wasm/ContactListener.d.ts.map +1 -1
- package/dist/box2d-wasm/ContactListener.js +50 -18
- package/dist/box2d-wasm/PhysicsComponent.d.ts +27 -30
- package/dist/box2d-wasm/PhysicsComponent.d.ts.map +1 -1
- package/dist/box2d-wasm/PhysicsComponent.js +44 -11
- package/dist/box2d-wasm/PhysicsSprite.d.ts +3 -0
- package/dist/box2d-wasm/PhysicsSprite.d.ts.map +1 -1
- package/dist/box2d-wasm/PhysicsSprite.js +24 -3
- package/dist/box2d-wasm/PhysicsSystem.d.ts +5 -3
- package/dist/box2d-wasm/PhysicsSystem.d.ts.map +1 -1
- package/dist/box2d-wasm/PhysicsSystem.js +135 -45
- package/dist/collider/CollideComponent.d.ts +27 -10
- package/dist/collider/CollideComponent.d.ts.map +1 -1
- package/dist/collider/CollideComponent.js +10 -12
- package/dist/collider/helper/Intersection.d.ts +6 -6
- package/dist/collider/helper/Intersection.d.ts.map +1 -1
- package/dist/collider/helper/Intersection.js +4 -4
- package/dist/collider/index.d.ts +1 -0
- package/dist/collider/index.d.ts.map +1 -1
- package/dist/collider/index.js +1 -0
- package/dist/components/NodeComp.d.ts +62 -36
- package/dist/components/NodeComp.d.ts.map +1 -1
- package/dist/components/NodeComp.js +18 -99
- package/dist/core/Color.d.ts.map +1 -1
- package/dist/dragonbones/DragonBonesComponent.d.ts +3 -2
- package/dist/dragonbones/DragonBonesComponent.d.ts.map +1 -1
- package/dist/dragonbones/DragonBonesComponent.js +1 -1
- package/dist/dragonbones/DragonBonesSystem.js +2 -2
- package/dist/gui/GUISystem.d.ts.map +1 -1
- package/dist/gui/GUISystem.js +5 -6
- package/dist/helper/utils.d.ts +0 -6
- package/dist/helper/utils.d.ts.map +1 -1
- package/dist/helper/utils.js +0 -12
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5
- package/dist/norender/NoRenderComponent.d.ts +5 -1
- package/dist/norender/NoRenderComponent.d.ts.map +1 -1
- package/dist/norender/NoRenderSystem.d.ts.map +1 -1
- package/dist/norender/NoRenderSystem.js +8 -9
- package/dist/render/RenderComponent.d.ts +6 -17
- package/dist/render/RenderComponent.d.ts.map +1 -1
- package/dist/render/RenderComponent.js +26 -18
- package/dist/spine/lib/require-shim.d.ts.map +1 -1
- package/dist/spine/lib/require-shim.js +1 -1
- package/package.json +6 -7
- package/.github/workflows/npm-publish.yml +0 -35
- package/src/app.ts +0 -91
- package/src/base/EnhancedComponent.ts +0 -38
- package/src/base/gworld.ts +0 -20
- package/src/base/index.ts +0 -14
- package/src/base/utils.ts +0 -23
- package/src/box2d-wasm/ContactListener.ts +0 -66
- package/src/box2d-wasm/PhysicsComponent.ts +0 -83
- package/src/box2d-wasm/PhysicsSprite.ts +0 -42
- package/src/box2d-wasm/PhysicsSystem.ts +0 -142
- package/src/box2d-wasm/debugDraw.ts +0 -249
- package/src/box2d-wasm/index.ts +0 -19
- package/src/collider/CollideComponent.ts +0 -257
- package/src/collider/CollideSystem.ts +0 -166
- package/src/collider/helper/Intersection.ts +0 -139
- package/src/collider/helper/utils.ts +0 -37
- package/src/collider/index.ts +0 -16
- package/src/components/BaseComponent.ts +0 -17
- package/src/components/NodeComp.ts +0 -442
- package/src/components/Scene.ts +0 -17
- package/src/core/Color.ts +0 -7
- package/src/core/LoadingBar.ts +0 -63
- package/src/core/NodePool.ts +0 -28
- package/src/core/Size.ts +0 -21
- package/src/core/Vec2.ts +0 -108
- package/src/core/director.ts +0 -11
- package/src/core/index.ts +0 -7
- package/src/core/loader.ts +0 -14
- package/src/core/math.ts +0 -22
- package/src/dragonbones/DragonBonesComponent.ts +0 -32
- package/src/dragonbones/DragonBonesSystem.ts +0 -35
- package/src/dragonbones/index.ts +0 -11
- package/src/gui/GUIComponent.ts +0 -155
- package/src/gui/GUISystem.ts +0 -125
- package/src/helper/utils.ts +0 -50
- package/src/index.ts +0 -21
- package/src/norender/NoRenderComponent.ts +0 -60
- package/src/norender/NoRenderSystem.ts +0 -67
- package/src/norender/Touch.ts +0 -37
- package/src/planck/PhysicsComponent.ts +0 -83
- package/src/planck/PhysicsSprite.ts +0 -43
- package/src/planck/PhysicsSystem.ts +0 -201
- package/src/planck/index.ts +0 -3
- package/src/render/RenderComponent.ts +0 -132
- package/src/render/RenderSystem.ts +0 -64
- package/src/richtext/RichTextComp.ts +0 -50
- package/src/richtext/RichTextSystem.ts +0 -26
- package/src/richtext/html-text-parser.ts +0 -87
- package/src/richtext/index.ts +0 -8
- package/src/spine/SpineComponent.ts +0 -18
- package/src/spine/SpineSystem.ts +0 -30
- package/src/spine/index.ts +0 -11
- package/src/spine/lib/BatchableSpineSlot.ts +0 -138
- package/src/spine/lib/Spine.ts +0 -894
- package/src/spine/lib/SpineDebugRenderer.ts +0 -615
- package/src/spine/lib/SpinePipe.ts +0 -203
- package/src/spine/lib/SpineTexture.ts +0 -143
- package/src/spine/lib/assets/atlasLoader.ts +0 -158
- package/src/spine/lib/assets/skeletonLoader.ts +0 -81
- package/src/spine/lib/darktint/DarkTintBatchGeometry.ts +0 -92
- package/src/spine/lib/darktint/DarkTintBatcher.ts +0 -186
- package/src/spine/lib/darktint/DarkTintShader.ts +0 -74
- package/src/spine/lib/darktint/darkTintBit.ts +0 -77
- package/src/spine/lib/index.ts +0 -43
- package/src/spine/lib/require-shim.ts +0 -43
- package/tsconfig.json +0 -18
- /package/{src/@types → @types}/index.d.ts +0 -0
|
@@ -1,58 +1,28 @@
|
|
|
1
1
|
import { actionManager } from 'pixi-action-ease';
|
|
2
2
|
import { Point, Sprite, Text } from 'pixi.js';
|
|
3
|
-
import { instantiate } from '
|
|
3
|
+
import { instantiate } from '..';
|
|
4
4
|
import { updatePoint, Vec2 } from '../core';
|
|
5
5
|
import { ProgressBarComp } from '../gui/GUIComponent';
|
|
6
6
|
import { ExtraDataComp } from '../norender/NoRenderComponent';
|
|
7
7
|
export class NodeComp {
|
|
8
|
-
setOnTouchStart(cb) {
|
|
9
|
-
this.onTouchStart = cb;
|
|
10
|
-
this.instance.on('touchstart', (event) => {
|
|
11
|
-
const { global } = event;
|
|
12
|
-
this.onTouchStart({ location: updatePoint(global) });
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
setOnTouchMove(cb) {
|
|
16
|
-
this.onTouchMove = cb;
|
|
17
|
-
this.instance.on('touchmove', (event) => {
|
|
18
|
-
const { global } = event;
|
|
19
|
-
this.onTouchMove({ location: updatePoint(global) });
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
setOnTouchEnd(cb) {
|
|
23
|
-
this.onTouchEnd = cb;
|
|
24
|
-
this.instance.on('touchend', (event) => {
|
|
25
|
-
const { global } = event;
|
|
26
|
-
this.onTouchEnd({ location: updatePoint(global) });
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
setOnTouchCancel(cb) {
|
|
30
|
-
this.onTouchCancel = cb;
|
|
31
|
-
this.instance.on('touchcancel', (event) => {
|
|
32
|
-
const { global } = event;
|
|
33
|
-
this.onTouchCancel({ location: updatePoint(global) });
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
8
|
constructor(instance, entity) {
|
|
37
|
-
this.events = {};
|
|
38
|
-
this.data = {};
|
|
39
9
|
this.children = [];
|
|
40
10
|
this.actionsList = [];
|
|
41
|
-
// private lastMove: { x: number; y: number }
|
|
42
11
|
this._group = 0;
|
|
43
12
|
this._active = true;
|
|
44
13
|
this.entity = entity;
|
|
45
14
|
this.instance = instance;
|
|
46
|
-
this.
|
|
15
|
+
this.anchorX = 0.5;
|
|
16
|
+
this.anchorY = 0.5;
|
|
47
17
|
}
|
|
48
18
|
get uuid() {
|
|
49
19
|
return this.entity.id;
|
|
50
20
|
}
|
|
51
21
|
get position() {
|
|
52
|
-
return this.
|
|
22
|
+
return updatePoint(this.instance.position);
|
|
53
23
|
}
|
|
54
24
|
set position(val) {
|
|
55
|
-
this.
|
|
25
|
+
this.instance.position = val;
|
|
56
26
|
}
|
|
57
27
|
get posX() {
|
|
58
28
|
return this.instance.x;
|
|
@@ -67,7 +37,7 @@ export class NodeComp {
|
|
|
67
37
|
this.instance.y = val;
|
|
68
38
|
}
|
|
69
39
|
set xy(val) {
|
|
70
|
-
this.
|
|
40
|
+
this.position = Vec2(val[0], val[1]);
|
|
71
41
|
}
|
|
72
42
|
get scale() {
|
|
73
43
|
return this.instance.scale.x;
|
|
@@ -90,7 +60,7 @@ export class NodeComp {
|
|
|
90
60
|
get anchorX() {
|
|
91
61
|
if (this.instance instanceof Sprite || this.instance instanceof Text)
|
|
92
62
|
return this.instance.anchor.x;
|
|
93
|
-
return 0;
|
|
63
|
+
return 0.5;
|
|
94
64
|
}
|
|
95
65
|
set anchorX(val) {
|
|
96
66
|
if (this.instance instanceof Sprite || this.instance instanceof Text)
|
|
@@ -99,7 +69,7 @@ export class NodeComp {
|
|
|
99
69
|
get anchorY() {
|
|
100
70
|
if (this.instance instanceof Sprite || this.instance instanceof Text)
|
|
101
71
|
return this.instance.anchor.y;
|
|
102
|
-
return 0;
|
|
72
|
+
return 0.5;
|
|
103
73
|
}
|
|
104
74
|
set anchorY(val) {
|
|
105
75
|
if (this.instance instanceof Sprite || this.instance instanceof Text)
|
|
@@ -135,10 +105,10 @@ export class NodeComp {
|
|
|
135
105
|
this.instance.style.fill = val;
|
|
136
106
|
}
|
|
137
107
|
get opacity() {
|
|
138
|
-
return this.instance.alpha;
|
|
108
|
+
return Math.round(this.instance.alpha * 255);
|
|
139
109
|
}
|
|
140
110
|
set opacity(val) {
|
|
141
|
-
this.instance.alpha = val;
|
|
111
|
+
this.instance.alpha = val / 255;
|
|
142
112
|
}
|
|
143
113
|
get active() {
|
|
144
114
|
if (!this._active)
|
|
@@ -171,7 +141,7 @@ export class NodeComp {
|
|
|
171
141
|
return this.instance.height;
|
|
172
142
|
}
|
|
173
143
|
set height(val) {
|
|
174
|
-
this.instance.
|
|
144
|
+
this.instance.setSize(this.width, val);
|
|
175
145
|
}
|
|
176
146
|
get zIndex() {
|
|
177
147
|
return this.instance.zIndex;
|
|
@@ -201,30 +171,13 @@ export class NodeComp {
|
|
|
201
171
|
return this.getComponentsInChildren(component)[0];
|
|
202
172
|
}
|
|
203
173
|
convertToNodeSpace(point) {
|
|
204
|
-
return this.instance.toLocal(point);
|
|
174
|
+
return updatePoint(this.instance.toLocal(point));
|
|
205
175
|
}
|
|
206
176
|
convertToNodeSpaceAR(point) {
|
|
207
|
-
return this.instance.toLocal(point);
|
|
177
|
+
return updatePoint(this.instance.toLocal(point));
|
|
208
178
|
}
|
|
209
179
|
convertToWorldSpaceAR(point) {
|
|
210
|
-
return this.instance.toGlobal(point);
|
|
211
|
-
}
|
|
212
|
-
getPosition() {
|
|
213
|
-
return updatePoint(this.instance.position);
|
|
214
|
-
}
|
|
215
|
-
setPosition(x, y) {
|
|
216
|
-
if (typeof x !== 'number') {
|
|
217
|
-
this.instance.position = Vec2(x.x, x.y);
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
this.instance.position = Vec2(x, y);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
setRotation(deg) {
|
|
224
|
-
this.instance.rotation = deg;
|
|
225
|
-
}
|
|
226
|
-
getRotation() {
|
|
227
|
-
return this.instance.rotation;
|
|
180
|
+
return updatePoint(this.instance.toGlobal(point));
|
|
228
181
|
}
|
|
229
182
|
// setAnchorPoint(point: number | cc.Point, y?: number) {
|
|
230
183
|
// this.instance.setAnchorPoint(point, y)
|
|
@@ -239,28 +192,11 @@ export class NodeComp {
|
|
|
239
192
|
// }
|
|
240
193
|
// return box
|
|
241
194
|
// }
|
|
242
|
-
|
|
243
|
-
return this.instance.
|
|
244
|
-
}
|
|
245
|
-
// setContentSize(size: cc.Size | number, height?: number) {
|
|
246
|
-
// this.instance.setContentSize(size, height)
|
|
247
|
-
// if (this.instance instanceof cc.ClippingNode) {
|
|
248
|
-
// const hw = ((size as any).width || size) * 0.5
|
|
249
|
-
// const hh = ((size as any).height || height) * 0.5
|
|
250
|
-
// const stencil = new cc.DrawNode()
|
|
251
|
-
// const rectangle = [cc.p(-hw, -hh), cc.p(hw, -hh), cc.p(hw, hh), cc.p(-hw, hh)]
|
|
252
|
-
// stencil.drawPoly(rectangle, cc.Color.WHITE, 0, cc.Color.WHITE)
|
|
253
|
-
// // stencil.drawDot(cc.p(-height * 0.5, -height * 0.5), height, cc.Color.WHITE);
|
|
254
|
-
// this.instance.stencil = stencil
|
|
255
|
-
// }
|
|
256
|
-
// }
|
|
257
|
-
setColor(color) {
|
|
258
|
-
if (this.instance instanceof Sprite)
|
|
259
|
-
this.instance.tint = color;
|
|
195
|
+
get contentSize() {
|
|
196
|
+
return this.instance.getSize();
|
|
260
197
|
}
|
|
261
|
-
|
|
262
|
-
this.instance.
|
|
263
|
-
this.instance.scale.y = scaleY || scaleX;
|
|
198
|
+
set contentSize(size) {
|
|
199
|
+
this.instance.setSize(size);
|
|
264
200
|
}
|
|
265
201
|
runAction(act) {
|
|
266
202
|
const animation = actionManager.runAction(this.instance, act);
|
|
@@ -317,23 +253,6 @@ export class NodeComp {
|
|
|
317
253
|
child.removeFromParent();
|
|
318
254
|
});
|
|
319
255
|
}
|
|
320
|
-
on(name, callback, target) {
|
|
321
|
-
const bound = target ? callback.bind(target) : callback;
|
|
322
|
-
if (this.events[name]) {
|
|
323
|
-
this.events[name].push(bound);
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
this.events[name] = [bound];
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
off(name) {
|
|
330
|
-
this.events[name] = undefined;
|
|
331
|
-
}
|
|
332
|
-
emit(name, ...params) {
|
|
333
|
-
if (this.events[name]) {
|
|
334
|
-
this.events[name].forEach((fc) => fc(...params));
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
256
|
resolveComponent(component) {
|
|
338
257
|
// console.log(component.constructor.name, (component.constructor as any).hasRender)
|
|
339
258
|
if (component.constructor.hasRender) {
|
package/dist/core/Color.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../src/core/Color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../src/core/Color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,SAEjE;AAED,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { BaseComponentProps } from "..";
|
|
1
2
|
import { ComponentX } from "../components/BaseComponent";
|
|
2
3
|
interface DragonBonesData {
|
|
3
4
|
atlas: string;
|
|
4
5
|
skeleton: string;
|
|
5
6
|
texture: string;
|
|
6
7
|
}
|
|
7
|
-
interface DragonBonesProps {
|
|
8
|
+
interface DragonBonesProps extends BaseComponentProps<DragonBonesComp> {
|
|
8
9
|
data: DragonBonesData;
|
|
9
10
|
skin?: string;
|
|
10
11
|
animation?: string;
|
|
@@ -20,7 +21,7 @@ interface DragonBonesProps {
|
|
|
20
21
|
name: string;
|
|
21
22
|
}) => void;
|
|
22
23
|
}
|
|
23
|
-
export declare class
|
|
24
|
+
export declare class DragonBonesComp extends ComponentX<DragonBonesProps> {
|
|
24
25
|
setAnimation(name: string, playTimes?: number): void;
|
|
25
26
|
setSkeletonData(data: string): void;
|
|
26
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragonBonesComponent.d.ts","sourceRoot":"","sources":["../../src/dragonbones/DragonBonesComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,UAAU,
|
|
1
|
+
{"version":3,"file":"DragonBonesComponent.d.ts","sourceRoot":"","sources":["../../src/dragonbones/DragonBonesComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,UAAU,gBAAiB,SAAQ,kBAAkB,CAAC,eAAe,CAAC;IACpE,IAAI,EAAE,eAAe,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IACpD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAClD,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACxD;AACD,qBAAa,eAAgB,SAAQ,UAAU,CAAC,gBAAgB,CAAC;IAE/D,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,SAAI;IAOxC,eAAe,CAAC,IAAI,EAAE,MAAM;CAK7B"}
|
|
@@ -2,10 +2,10 @@ import { PixiFactory } from 'dragonbones-pixijs';
|
|
|
2
2
|
import { EventTypes } from 'entityx-ts';
|
|
3
3
|
import { Assets } from 'pixi.js';
|
|
4
4
|
import { NodeComp } from '../components/NodeComp';
|
|
5
|
-
import {
|
|
5
|
+
import { DragonBonesComp } from './DragonBonesComponent';
|
|
6
6
|
export class DragonBonesSystem {
|
|
7
7
|
configure(event_manager) {
|
|
8
|
-
event_manager.subscribe(EventTypes.ComponentAdded,
|
|
8
|
+
event_manager.subscribe(EventTypes.ComponentAdded, DragonBonesComp, ({ entity, component }) => {
|
|
9
9
|
const { data, animation, playTimes = 0 } = component.props;
|
|
10
10
|
const { skeleton, atlas, texture } = data;
|
|
11
11
|
const skeletonAsset = Assets.get(skeleton);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/gui/GUISystem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,YAAY,CAAA;AAK7D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAenC,qBAAa,SAAU,YAAW,MAAM;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/gui/GUISystem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,YAAY,CAAA;AAK7D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAenC,qBAAa,SAAU,YAAW,MAAM;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,SAAS,CAAC;CAoGjD"}
|
package/dist/gui/GUISystem.js
CHANGED
|
@@ -9,18 +9,17 @@ export class GUISystem {
|
|
|
9
9
|
configure(event_manager) {
|
|
10
10
|
event_manager.subscribe(EventTypes.ComponentAdded, ButtonComp, ({ entity, component }) => {
|
|
11
11
|
const nodeComp = entity.getComponent(NodeComp);
|
|
12
|
-
|
|
13
|
-
// console.log('onPress.ButtonComp', component)
|
|
12
|
+
const { zoomScale = 1.2 } = component.props;
|
|
14
13
|
const button = new Button(nodeComp.instance);
|
|
15
|
-
// node.setZoomScale(zoomScale - 1)
|
|
16
14
|
component.node = nodeComp;
|
|
17
|
-
|
|
15
|
+
const lastScaleX = nodeComp.scaleX;
|
|
16
|
+
const lastScaleY = nodeComp.scaleY;
|
|
18
17
|
button.onPress.connect(() => {
|
|
19
18
|
if (!component.enabled)
|
|
20
19
|
return;
|
|
21
20
|
// console.log('onPress.connect')
|
|
22
|
-
const scale = scaleTo(0.
|
|
23
|
-
const scaleDown = scaleTo(0.
|
|
21
|
+
const scale = scaleTo(0.3, zoomScale * lastScaleX, lastScaleY * zoomScale);
|
|
22
|
+
const scaleDown = scaleTo(0.3, lastScaleX, lastScaleY);
|
|
24
23
|
const seq = sequence(scale, callFunc(() => {
|
|
25
24
|
if (Object.prototype.hasOwnProperty.call(component.props, 'onPress')) {
|
|
26
25
|
component.props.onPress(component);
|
package/dist/helper/utils.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { Constructor, EntityManager, EventManager } from 'entityx-ts';
|
|
2
|
-
import { Point } from 'pixi.js';
|
|
3
2
|
import { EnhancedComponent, GameWorld } from '../base';
|
|
4
|
-
export declare function v2(x?: number | {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}, y?: number): Point;
|
|
8
|
-
export declare function getDistance(point1: Point, point2: Point): number;
|
|
9
3
|
export declare function registerSystem<T extends EnhancedComponent<any>>(component: Constructor<T>): {
|
|
10
4
|
new (): {
|
|
11
5
|
configure(event_manager: EventManager<GameWorld>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/helper/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAoC,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/helper/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAoC,MAAM,YAAY,CAAA;AACvG,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAItD,wBAAgB,cAAc,CAAC,CAAC,SAAS,iBAAiB,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;;iCAK7D,YAAY,CAAC,SAAS,CAAC;yBAU/B,aAAa,UAAU,YAAY,CAAC,SAAS,CAAC,MAAM,MAAM;;EAe9E"}
|
package/dist/helper/utils.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { EventTypes } from 'entityx-ts';
|
|
2
|
-
import { Point } from 'pixi.js';
|
|
3
2
|
import { GameWorld } from '../base';
|
|
4
3
|
import { NodeComp } from '../components/NodeComp';
|
|
5
|
-
export function v2(x = 0, y = 0) {
|
|
6
|
-
if (typeof x === 'object' && 'x' in x && 'y' in x) {
|
|
7
|
-
return new Point(x.x, x.y);
|
|
8
|
-
}
|
|
9
|
-
return new Point(x, y);
|
|
10
|
-
}
|
|
11
|
-
export function getDistance(point1, point2) {
|
|
12
|
-
const dx = point2.x - point1.x;
|
|
13
|
-
const dy = point2.y - point1.y;
|
|
14
|
-
return Math.sqrt(dx * dx + dy * dy);
|
|
15
|
-
}
|
|
16
4
|
export function registerSystem(component) {
|
|
17
5
|
if (GameWorld.Instance.systems.isRegistered(`${component.name}System`)) {
|
|
18
6
|
return;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,13 +2,10 @@ export * from 'pixi-action-ease';
|
|
|
2
2
|
export * from 'pixi.js';
|
|
3
3
|
export * from './app';
|
|
4
4
|
export * from './base';
|
|
5
|
-
export * from './collider';
|
|
6
|
-
export * from './collider/helper/Intersection';
|
|
7
5
|
export * from './components/BaseComponent';
|
|
8
6
|
export * from './components/NodeComp';
|
|
9
7
|
export * from './components/Scene';
|
|
10
8
|
export * from './core';
|
|
11
|
-
export * from './dragonbones';
|
|
12
9
|
export * from './gui/GUIComponent';
|
|
13
10
|
export * from './gui/GUISystem';
|
|
14
11
|
export * from './helper/utils';
|
|
@@ -16,6 +13,4 @@ export * from './norender/NoRenderComponent';
|
|
|
16
13
|
export * from './norender/Touch';
|
|
17
14
|
export * from './render/RenderComponent';
|
|
18
15
|
export * from './render/RenderSystem';
|
|
19
|
-
export * from './richtext';
|
|
20
|
-
export * from './spine';
|
|
21
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,QAAQ,CAAA;AACtB,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,13 +2,10 @@ export * from 'pixi-action-ease';
|
|
|
2
2
|
export * from 'pixi.js';
|
|
3
3
|
export * from './app';
|
|
4
4
|
export * from './base';
|
|
5
|
-
export * from './collider';
|
|
6
|
-
export * from './collider/helper/Intersection';
|
|
7
5
|
export * from './components/BaseComponent';
|
|
8
6
|
export * from './components/NodeComp';
|
|
9
7
|
export * from './components/Scene';
|
|
10
8
|
export * from './core';
|
|
11
|
-
export * from './dragonbones';
|
|
12
9
|
export * from './gui/GUIComponent';
|
|
13
10
|
export * from './gui/GUISystem';
|
|
14
11
|
export * from './helper/utils';
|
|
@@ -16,5 +13,3 @@ export * from './norender/NoRenderComponent';
|
|
|
16
13
|
export * from './norender/Touch';
|
|
17
14
|
export * from './render/RenderComponent';
|
|
18
15
|
export * from './render/RenderSystem';
|
|
19
|
-
export * from './richtext';
|
|
20
|
-
export * from './spine';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { NoRenderComponentX } from '../components/BaseComponent';
|
|
2
|
-
import {
|
|
2
|
+
import { NodeComp } from '../components/NodeComp';
|
|
3
3
|
import { Touch } from './Touch';
|
|
4
|
+
export type EventCallbackType = (...args: any[]) => void;
|
|
5
|
+
export interface EventMap {
|
|
6
|
+
[key: string]: [EventCallbackType];
|
|
7
|
+
}
|
|
4
8
|
export type TouchEventCallback = (touch?: Touch, node?: NodeComp) => void;
|
|
5
9
|
export declare class EventRegister extends NoRenderComponentX {
|
|
6
10
|
events: EventMap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoRenderComponent.d.ts","sourceRoot":"","sources":["../../src/norender/NoRenderComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"NoRenderComponent.d.ts","sourceRoot":"","sources":["../../src/norender/NoRenderComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,OAAA,KAAK,IAAI,CAAA;AACjD,MAAM,WAAW,QAAQ;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,iBAAiB,CAAC,CAAA;CACnC;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAA;AAEzE,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;CAKlC;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,aAAa,CAAA;IACvB,KAAK,EAAE,KAAK,CAAA;CACb;AAED,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,GAAG,CAAA;CACX;AACD,qBAAa,aAAc,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACnE,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAK;IAEjC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;IAG1B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;CAG/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoRenderSystem.d.ts","sourceRoot":"","sources":["../../src/norender/NoRenderSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"NoRenderSystem.d.ts","sourceRoot":"","sources":["../../src/norender/NoRenderSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,YAAY,CAAA;AAO7D,qBAAa,cAAe,YAAW,MAAM;IAC3C,SAAS,CAAC,aAAa,EAAE,YAAY;CAwDtC"}
|
|
@@ -14,31 +14,30 @@ export class NoRenderSystem {
|
|
|
14
14
|
const nodeComp = ett.getComponent(NodeComp);
|
|
15
15
|
touchComp.node = nodeComp;
|
|
16
16
|
const container = nodeComp.instance;
|
|
17
|
+
container.eventMode = 'static';
|
|
17
18
|
if (touchComp.props.onTouchStart) {
|
|
18
|
-
container.on('
|
|
19
|
+
container.on('touchstart', (event) => {
|
|
19
20
|
touchComp.props.onTouchStart(new Touch(event), nodeComp);
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
if (touchComp.props.onTouchMove) {
|
|
23
|
-
container.on('
|
|
24
|
+
container.on('touchmove', (event) => {
|
|
24
25
|
touchComp.props.onTouchMove(new Touch(event), nodeComp);
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
if (touchComp.props.onTouchEnd) {
|
|
28
|
-
container.on('
|
|
29
|
+
container.on('touchend', (event) => {
|
|
29
30
|
touchComp.props.onTouchEnd(new Touch(event), nodeComp);
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
|
-
if (touchComp.props.
|
|
33
|
-
container.on('
|
|
34
|
-
touchComp.props.
|
|
33
|
+
if (touchComp.props.onTouchCancel) {
|
|
34
|
+
container.on('touchcancel', (event) => {
|
|
35
|
+
touchComp.props.onTouchCancel(new Touch(event), nodeComp);
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
event_manager.subscribe(EventTypes.ComponentRemoved, TouchEventRegister, ({ component }) => {
|
|
39
|
-
console.log('ComponentRemovedEvent TouchEventRegister',
|
|
40
|
-
// const ett = event.entity
|
|
41
|
-
// const nodeComp = ett.getComponent(NodeComp)
|
|
40
|
+
console.log('ComponentRemovedEvent TouchEventRegister', component);
|
|
42
41
|
const touchComp = component;
|
|
43
42
|
const container = touchComp.node.instance;
|
|
44
43
|
if (touchComp.props.onTouchStart) {
|
|
@@ -15,29 +15,18 @@ export declare class SpriteRender extends ComponentX<SpriteRenderProps, Sprite>
|
|
|
15
15
|
get spriteFrame(): string;
|
|
16
16
|
set spriteFrame(frame: string);
|
|
17
17
|
}
|
|
18
|
-
declare enum PointType {
|
|
19
|
-
Circle = 0,
|
|
20
|
-
Rect = 1
|
|
21
|
-
}
|
|
22
18
|
interface GraphicsRenderProps extends BaseComponentProps<GraphicsRender> {
|
|
23
19
|
lineWidth?: number;
|
|
24
20
|
strokeColor?: Color4B;
|
|
25
21
|
fillColor?: Color4B;
|
|
26
22
|
}
|
|
27
23
|
export declare class GraphicsRender extends ComponentX<GraphicsRenderProps, Graphics> {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
drawQuadBezier(origin: Vec2, destination: Vec2, color: Color4B): void;
|
|
35
|
-
drawCubicBezier(origin: Vec2, destination: Vec2, color: Color4B): void;
|
|
36
|
-
drawCardinalSpline(points: Vec2[], color: Color4B): void;
|
|
37
|
-
drawCatmullRom(points: Vec2[], color: Color4B): void;
|
|
38
|
-
drawPoly(points: Vec2[], color?: Color4B, thickness?: Float): void;
|
|
39
|
-
drawSolidPoly(points: Vec2[], color: Color4B): void;
|
|
40
|
-
drawDot(points: Vec2[], color: Color4B): void;
|
|
24
|
+
drawRect(origin: Vec2, destination: Vec2, color?: Color4B): void;
|
|
25
|
+
drawSolidRect(origin: Vec2, destination: Vec2, color?: Color4B): void;
|
|
26
|
+
drawCircle(center: Vec2, radius: Float, color?: Color4B): void;
|
|
27
|
+
drawSolidCircle(center: Vec2, radius: Float, color?: Color4B): void;
|
|
28
|
+
drawPoly(points: Vec2[], color?: Color4B): void;
|
|
29
|
+
drawSolidPoly(points: Vec2[], color?: Color4B): void;
|
|
41
30
|
drawSegment(from: Vec2, to: Vec2, thickness?: Float, color?: Color4B): void;
|
|
42
31
|
drawTriangle(p1: Vec2, p2: Vec2, p3: Vec2, color: Color4B): void;
|
|
43
32
|
clear(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderComponent.d.ts","sourceRoot":"","sources":["../../src/render/RenderComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAW,MAAM,SAAS,CAAA;AAEnD,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,qBAAa,UAAW,SAAQ,UAAU;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,UAAU,iBAAkB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IAClE,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,QAAQ,CAAC,EAAE,cAAc,CAAA;CAI1B;AAED,qBAAa,YAAa,SAAQ,UAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAcrE,IAAI,WAAW,WAEd;IAED,IAAI,WAAW,CAAC,KAAK,QAAA,EAkBpB;CACF;AACD,
|
|
1
|
+
{"version":3,"file":"RenderComponent.d.ts","sourceRoot":"","sources":["../../src/render/RenderComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAW,MAAM,SAAS,CAAA;AAEnD,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,qBAAa,UAAW,SAAQ,UAAU;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,UAAU,iBAAkB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IAClE,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,QAAQ,CAAC,EAAE,cAAc,CAAA;CAI1B;AAED,qBAAa,YAAa,SAAQ,UAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAcrE,IAAI,WAAW,WAEd;IAED,IAAI,WAAW,CAAC,KAAK,QAAA,EAkBpB;CACF;AACD,UAAU,mBAAoB,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AACD,qBAAa,cAAe,SAAQ,UAAU,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAK3E,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO;IAOzD,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO;IAO9D,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO;IAKvD,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO;IAS5D,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO;IAIxC,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO;IAK7C,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO;IAWpE,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO;IAIzD,KAAK;CAGN;AAED,UAAU,eAAgB,SAAQ,kBAAkB,CAAC,UAAU,CAAC;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AACD,qBAAa,UAAW,SAAQ,UAAU,CAAC,eAAe,CAAC;CAAG"}
|
|
@@ -38,40 +38,48 @@ export class SpriteRender extends ComponentX {
|
|
|
38
38
|
// }
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
var PointType;
|
|
42
|
-
(function (PointType) {
|
|
43
|
-
PointType[PointType["Circle"] = 0] = "Circle";
|
|
44
|
-
PointType[PointType["Rect"] = 1] = "Rect";
|
|
45
|
-
})(PointType || (PointType = {}));
|
|
46
41
|
export class GraphicsRender extends ComponentX {
|
|
47
|
-
drawPoint(
|
|
42
|
+
// drawPoint(_pointType = PointType.Rect) {}
|
|
48
43
|
// drawPoints(points: Vec2[], color: Color4B) {
|
|
49
44
|
// }
|
|
50
|
-
drawLine(
|
|
45
|
+
// drawLine() {}
|
|
51
46
|
drawRect(origin, destination, color) {
|
|
52
47
|
const { x, y } = origin;
|
|
53
48
|
const width = destination.x - x;
|
|
54
49
|
const height = destination.y - y;
|
|
55
50
|
this.node.instance.rect(x, y, width, height);
|
|
56
|
-
this.node.instance.
|
|
51
|
+
this.node.instance.stroke(color || this.props.strokeColor);
|
|
52
|
+
}
|
|
53
|
+
drawSolidRect(origin, destination, color) {
|
|
54
|
+
const { x, y } = origin;
|
|
55
|
+
const width = destination.x - x;
|
|
56
|
+
const height = destination.y - y;
|
|
57
|
+
this.node.instance.rect(x, y, width, height);
|
|
58
|
+
this.node.instance.fill(color || this.props.fillColor);
|
|
59
|
+
}
|
|
60
|
+
drawCircle(center, radius, color) {
|
|
61
|
+
const { x, y } = center;
|
|
62
|
+
this.node.instance.circle(x, y, radius);
|
|
63
|
+
this.node.instance.stroke(color || this.props.strokeColor);
|
|
57
64
|
}
|
|
58
|
-
|
|
59
|
-
drawCircle(center, radius, angle, segments, drawLineToCenter, scaleX, scaleY, color, thickness) {
|
|
65
|
+
drawSolidCircle(center, radius, color) {
|
|
60
66
|
const { x, y } = center;
|
|
61
67
|
this.node.instance.circle(x, y, radius);
|
|
62
68
|
this.node.instance.fill(color);
|
|
63
69
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
// drawQuadBezier() {}
|
|
71
|
+
// drawCubicBezier() {}
|
|
72
|
+
// drawCardinalSpline() {}
|
|
73
|
+
// drawCatmullRom() {}
|
|
74
|
+
drawPoly(points, color) {
|
|
75
|
+
this.node.instance.poly(points, true);
|
|
76
|
+
this.node.instance.stroke(color || this.props.strokeColor);
|
|
77
|
+
}
|
|
78
|
+
drawSolidPoly(points, color) {
|
|
70
79
|
this.node.instance.poly(points, true);
|
|
71
80
|
this.node.instance.fill(color || this.props.fillColor);
|
|
72
81
|
}
|
|
73
|
-
|
|
74
|
-
drawDot(points, color) { }
|
|
82
|
+
// drawDot() {}
|
|
75
83
|
drawSegment(from, to, thickness, color) {
|
|
76
84
|
this.node.instance.moveTo(from.x, from.y);
|
|
77
85
|
this.node.instance.lineTo(to.x, to.y);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-shim.d.ts","sourceRoot":"","sources":["../../../src/spine/lib/require-shim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;AAE/E,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,IAAI,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"require-shim.d.ts","sourceRoot":"","sources":["../../../src/spine/lib/require-shim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;AAE/E,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,IAAI,EAAE,GAAG,CAAA;CACd;AAUD,OAAO,EAAG,CAAC"}
|
|
@@ -31,7 +31,7 @@ if (typeof window !== 'undefined' && window.PIXI) {
|
|
|
31
31
|
window.require = (x) => {
|
|
32
32
|
if (prevRequire)
|
|
33
33
|
return prevRequire(x);
|
|
34
|
-
else if (x.startsWith(
|
|
34
|
+
else if (x.startsWith('@pixi/') || x.startsWith('pixi.js'))
|
|
35
35
|
return window.PIXI;
|
|
36
36
|
};
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@safe-engine/pixi",
|
|
3
|
-
"version": "8.4
|
|
3
|
+
"version": "8.5.4",
|
|
4
4
|
"description": "safex pixi plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"@types"
|
|
11
|
+
],
|
|
8
12
|
"scripts": {
|
|
9
|
-
"
|
|
10
|
-
"start": "parcel src/index.html -p 8080",
|
|
11
|
-
"dev": "parcel src/index.html -p 8080 --no-cache",
|
|
12
|
-
"build": "tsc & copyfiles -f ./src/@types/* ./dist/@types",
|
|
13
|
+
"build": "tsc",
|
|
13
14
|
"fix": "eslint ./src --ext .ts --fix"
|
|
14
15
|
},
|
|
15
16
|
"keywords": [],
|
|
@@ -18,9 +19,7 @@
|
|
|
18
19
|
"dependencies": {
|
|
19
20
|
"@esotericsoftware/spine-core": "^4.2.87",
|
|
20
21
|
"@pixi/ui": "^2.2.4",
|
|
21
|
-
"@types/node": "^24.0.15",
|
|
22
22
|
"box2d-wasm": "^7.0.0",
|
|
23
|
-
"copyfiles": "^2.4.1",
|
|
24
23
|
"dragonbones-pixijs": "^1.0.5",
|
|
25
24
|
"entityx-ts": "^2.2.1",
|
|
26
25
|
"pixi-action-ease": "^3.2.3",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Publish NPM Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types: [created]
|
|
9
|
-
workflow_dispatch: # Allows you to run this workflow manually
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
- uses: actions/setup-node@v3
|
|
17
|
-
with:
|
|
18
|
-
node-version: 20
|
|
19
|
-
- run: npm ci
|
|
20
|
-
- run: npm run build
|
|
21
|
-
|
|
22
|
-
publish-npm:
|
|
23
|
-
needs: build
|
|
24
|
-
runs-on: ubuntu-latest
|
|
25
|
-
steps:
|
|
26
|
-
- uses: actions/checkout@v4
|
|
27
|
-
- uses: actions/setup-node@v3
|
|
28
|
-
with:
|
|
29
|
-
node-version: 20
|
|
30
|
-
registry-url: https://registry.npmjs.org/
|
|
31
|
-
- run: npm ci
|
|
32
|
-
- run: npm run build
|
|
33
|
-
- run: npm publish
|
|
34
|
-
env:
|
|
35
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|