@safe-engine/pixi 7.0.3 → 8.0.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 +4 -4
- package/dist/app.d.ts +2 -2
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +20 -17
- package/dist/components/GUIComponent.d.ts +6 -4
- package/dist/components/GUIComponent.d.ts.map +1 -1
- package/dist/components/GUIComponent.js +1 -2
- package/dist/components/NodeComp.js +1 -1
- package/dist/components/RenderComponent.d.ts +1 -1
- package/dist/core/LoadingBar.js +8 -8
- package/dist/systems/GUISystem.d.ts.map +1 -1
- package/dist/systems/GUISystem.js +2 -7
- package/dist/systems/RenderSystem.d.ts.map +1 -1
- package/dist/systems/RenderSystem.js +3 -2
- package/package.json +5 -5
- package/.github/workflows/npm-publish.yml +0 -35
- package/dist/components/EnhancedComponent.d.ts +0 -22
- package/dist/components/EnhancedComponent.d.ts.map +0 -1
- package/dist/components/EnhancedComponent.js +0 -62
- package/dist/core/Scene.d.ts +0 -6
- package/dist/core/Scene.d.ts.map +0 -1
- package/dist/core/Scene.js +0 -39
- package/dist/core/Vec2.d.ts +0 -20
- package/dist/core/Vec2.d.ts.map +0 -1
- package/dist/core/Vec2.js +0 -70
- package/dist/core/decorator.d.ts +0 -9
- package/dist/core/decorator.d.ts.map +0 -1
- package/dist/core/decorator.js +0 -46
- package/dist/gworld.d.ts +0 -8
- package/dist/gworld.d.ts.map +0 -1
- package/dist/gworld.js +0 -43
- package/dist/helper/utils.d.ts +0 -11
- package/dist/helper/utils.d.ts.map +0 -1
- package/dist/helper/utils.js +0 -40
- package/src/app.ts +0 -53
- package/src/components/GUIComponent.ts +0 -141
- package/src/components/NodeComp.ts +0 -416
- package/src/components/RenderComponent.ts +0 -66
- package/src/core/Color.ts +0 -3
- package/src/core/LoadingBar.ts +0 -63
- package/src/core/Size.ts +0 -21
- package/src/helper/html-text-parser.ts +0 -364
- package/src/index.ts +0 -7
- package/src/systems/GUISystem.ts +0 -80
- package/src/systems/RenderSystem.ts +0 -70
- package/tsconfig.json +0 -24
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Guide
|
|
2
|
-
- components must be in `tsx` extension
|
|
3
|
-
- `$ref` bind with current class property as string
|
|
4
|
-
- every property start with `$` will reference to current class property as string
|
|
1
|
+
# Guide
|
|
2
|
+
- components must be in `tsx` extension
|
|
3
|
+
- `$ref` bind with current class property as string
|
|
4
|
+
- every property start with `$` will reference to current class property as string
|
package/dist/app.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Constructor, System } from 'entityx-ts';
|
|
2
2
|
import { Application } from 'pixi.js';
|
|
3
|
-
export declare const app: Application<import("pixi.js").
|
|
3
|
+
export declare const app: Application<import("pixi.js").Renderer>;
|
|
4
|
+
export declare function addGameCanvasTo(id?: string): Promise<void>;
|
|
4
5
|
export declare function setupResolution(designedResolution?: {
|
|
5
6
|
width: number;
|
|
6
7
|
height: number;
|
|
7
8
|
}): void;
|
|
8
|
-
export declare function addGameCanvasTo(id?: string): Promise<void>;
|
|
9
9
|
export declare function startGameWithSystems(systemsList: Constructor<System>[]): void;
|
|
10
10
|
//# sourceMappingURL=app.d.ts.map
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAKrC,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAKrC,eAAO,MAAM,GAAG,yCAAoB,CAAA;AAEpC,wBAAsB,eAAe,CAAC,EAAE,SAAS,iBAehD;AAED,wBAAgB,eAAe,CAAC,kBAAkB;;;CAA+B,QAKhF;AAYD,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,QAWtE"}
|
package/dist/app.js
CHANGED
|
@@ -10,35 +10,38 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.app = void 0;
|
|
13
|
-
exports.setupResolution = setupResolution;
|
|
14
13
|
exports.addGameCanvasTo = addGameCanvasTo;
|
|
14
|
+
exports.setupResolution = setupResolution;
|
|
15
15
|
exports.startGameWithSystems = startGameWithSystems;
|
|
16
16
|
const core_1 = require("@safe-engine/core");
|
|
17
17
|
const pixi_js_1 = require("pixi.js");
|
|
18
18
|
const pixi_action_ease_1 = require("pixi-action-ease");
|
|
19
19
|
const NodeComp_1 = require("./components/NodeComp");
|
|
20
|
-
exports.app = new pixi_js_1.Application(
|
|
21
|
-
width: 1080,
|
|
22
|
-
height: 1920,
|
|
23
|
-
antialias: true,
|
|
24
|
-
resolution: window.devicePixelRatio,
|
|
25
|
-
});
|
|
26
|
-
function setupResolution(designedResolution = { width: 720, height: 1280 }) {
|
|
27
|
-
const { width, height } = designedResolution;
|
|
28
|
-
exports.app.renderer.resize(width, height);
|
|
29
|
-
}
|
|
20
|
+
exports.app = new pixi_js_1.Application();
|
|
30
21
|
function addGameCanvasTo() {
|
|
31
22
|
return __awaiter(this, arguments, void 0, function* (id = 'game') {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
yield exports.app.init({
|
|
24
|
+
antialias: true,
|
|
25
|
+
resolution: window.devicePixelRatio,
|
|
26
|
+
resizeTo: window,
|
|
27
|
+
eventFeatures: {
|
|
28
|
+
move: true,
|
|
29
|
+
/** disables the global move events which can be very expensive in large scenes */
|
|
30
|
+
globalMove: false,
|
|
31
|
+
click: true,
|
|
32
|
+
wheel: false,
|
|
33
|
+
},
|
|
34
|
+
canvas: document.getElementById(id)
|
|
36
35
|
});
|
|
37
|
-
const gameDiv = document.getElementById(id);
|
|
38
|
-
gameDiv.appendChild(exports.app.view);
|
|
39
36
|
core_1.GameWorld.Instance.setup(NodeComp_1.NodeComp, exports.app.stage);
|
|
40
37
|
});
|
|
41
38
|
}
|
|
39
|
+
function setupResolution(designedResolution = { width: 720, height: 1280 }) {
|
|
40
|
+
const { width, height } = designedResolution;
|
|
41
|
+
exports.app.renderer.resize(width, height);
|
|
42
|
+
// app.stage.position.y = app.renderer.height / app.renderer.resolution
|
|
43
|
+
// app.stage.scale.y = -1
|
|
44
|
+
}
|
|
42
45
|
function startGameLoop(world) {
|
|
43
46
|
// Listen for frame updates
|
|
44
47
|
exports.app.ticker.add(() => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { ProgressBar } from '@pixi/ui';
|
|
1
2
|
import { ComponentX, NoRenderComponentX } from '@safe-engine/core';
|
|
2
3
|
import { Container, Point, Text } from 'pixi.js';
|
|
3
4
|
import { Color4B } from '../core/Color';
|
|
4
|
-
import {
|
|
5
|
+
import { LoadingBarMode, ProgressTimer } from '../core/LoadingBar';
|
|
5
6
|
import { NodeComp } from './NodeComp';
|
|
6
7
|
export declare const FillType: {
|
|
7
8
|
HORIZONTAL: number;
|
|
@@ -19,10 +20,11 @@ export declare class ButtonComp extends NoRenderComponentX<NodeComp> {
|
|
|
19
20
|
setOnPress(cb: (target: ButtonComp) => void): void;
|
|
20
21
|
set enabled(val: any);
|
|
21
22
|
}
|
|
22
|
-
export declare class ProgressBarComp extends NoRenderComponentX<NodeComp<
|
|
23
|
+
export declare class ProgressBarComp extends NoRenderComponentX<NodeComp<ProgressBar>> {
|
|
23
24
|
mode: LoadingBarMode;
|
|
24
|
-
private _progress;
|
|
25
25
|
isReverse: boolean;
|
|
26
|
+
bg: string;
|
|
27
|
+
fill: string;
|
|
26
28
|
get progress(): number;
|
|
27
29
|
set progress(val: number);
|
|
28
30
|
}
|
|
@@ -32,7 +34,7 @@ export declare class LabelComp extends ComponentX<NodeComp<Text>> {
|
|
|
32
34
|
size: number;
|
|
33
35
|
getString(): string;
|
|
34
36
|
setString(val: string): void;
|
|
35
|
-
getSize():
|
|
37
|
+
getSize(): number;
|
|
36
38
|
setSize(val: any): void;
|
|
37
39
|
getFont(): string;
|
|
38
40
|
setFont(val: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUIComponent.d.ts","sourceRoot":"","sources":["../../src/components/GUIComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAU,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GUIComponent.d.ts","sourceRoot":"","sources":["../../src/components/GUIComponent.ts"],"names":[],"mappings":"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"}
|
|
@@ -25,10 +25,9 @@ class ProgressBarComp extends core_1.NoRenderComponentX {
|
|
|
25
25
|
this.mode = LoadingBar_1.LoadingBarMode.BAR;
|
|
26
26
|
}
|
|
27
27
|
get progress() {
|
|
28
|
-
return this.
|
|
28
|
+
return this.node.instance.progress;
|
|
29
29
|
}
|
|
30
30
|
set progress(val) {
|
|
31
|
-
this._progress = val;
|
|
32
31
|
this.node.instance.progress = val;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
@@ -228,7 +228,7 @@ class NodeComp {
|
|
|
228
228
|
// return box
|
|
229
229
|
// }
|
|
230
230
|
getContentSize() {
|
|
231
|
-
return this.instance.
|
|
231
|
+
return this.instance.boundsArea;
|
|
232
232
|
}
|
|
233
233
|
// setContentSize(size: cc.Size | number, height?: number) {
|
|
234
234
|
// this.instance.setContentSize(size, height)
|
|
@@ -14,7 +14,7 @@ export declare class SpriteRender extends ComponentX<NodeComp<Sprite>> {
|
|
|
14
14
|
fillCenter: Point;
|
|
15
15
|
loadingBar: LoadingBar;
|
|
16
16
|
setFillRange(val: number): void;
|
|
17
|
-
getSpriteFrame(): TextureSource
|
|
17
|
+
getSpriteFrame(): TextureSource<any>;
|
|
18
18
|
setSpriteFrame(frame: any): void;
|
|
19
19
|
}
|
|
20
20
|
export declare class GraphicsRender extends ComponentX<NodeComp<Graphics>> {
|
package/dist/core/LoadingBar.js
CHANGED
|
@@ -13,17 +13,17 @@ class LoadingBar extends pixi_js_1.Graphics {
|
|
|
13
13
|
this.fillCenter = new pixi_js_1.Point(0.5, 0.5);
|
|
14
14
|
this.spriteComp = spriteComp;
|
|
15
15
|
this.mode = mode || LoadingBarMode.BAR;
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
16
|
+
this.fill(0xffffff);
|
|
17
|
+
this.rect(0, 0, spriteComp.width, spriteComp.height);
|
|
18
18
|
spriteComp.mask = this;
|
|
19
19
|
spriteComp.addChild(this);
|
|
20
20
|
}
|
|
21
21
|
set progress(val) {
|
|
22
22
|
this.clear();
|
|
23
|
-
this.
|
|
23
|
+
this.fill(0xffffff);
|
|
24
24
|
if (this.mode === LoadingBarMode.BAR) {
|
|
25
25
|
const spriteComp = this.spriteComp;
|
|
26
|
-
this.
|
|
26
|
+
this.rect(0, 0, spriteComp.width * val, spriteComp.height);
|
|
27
27
|
// console.log('new length', spriteComp.width)
|
|
28
28
|
this.x = -spriteComp.width * 0.5;
|
|
29
29
|
this.y = -spriteComp.height * 0.5;
|
|
@@ -39,8 +39,8 @@ class ProgressTimer extends pixi_js_1.Container {
|
|
|
39
39
|
this.spriteComp = pixi_js_1.Sprite.from(texture);
|
|
40
40
|
this.graphics = new pixi_js_1.Graphics();
|
|
41
41
|
this.mode = mode || LoadingBarMode.BAR;
|
|
42
|
-
this.graphics.
|
|
43
|
-
this.graphics.
|
|
42
|
+
this.graphics.fill(0xffffff);
|
|
43
|
+
this.graphics.rect(0, 0, this.spriteComp.width, this.spriteComp.height);
|
|
44
44
|
this.spriteComp.mask = this.graphics;
|
|
45
45
|
this.addChild(this.graphics);
|
|
46
46
|
this.addChild(this.spriteComp);
|
|
@@ -50,9 +50,9 @@ class ProgressTimer extends pixi_js_1.Container {
|
|
|
50
50
|
set progress(val) {
|
|
51
51
|
this.graphics.clear();
|
|
52
52
|
if (this.mode === LoadingBarMode.BAR) {
|
|
53
|
-
this.graphics.
|
|
54
|
-
this.graphics.drawRect(0, 0, this.spriteComp.width * val, this.spriteComp.height);
|
|
53
|
+
this.graphics.rect(0, 0, this.spriteComp.width * val, this.spriteComp.height);
|
|
55
54
|
// console.log('new length', this.width)
|
|
55
|
+
this.graphics.fill(0xffffff);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/systems/GUISystem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EACL,YAAY,EAEZ,MAAM,EACP,MAAM,YAAY,CAAA;AAQnB,qBAAa,SAAU,YAAW,MAAM;IACtC,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/systems/GUISystem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EACL,YAAY,EAEZ,MAAM,EACP,MAAM,YAAY,CAAA;AAQnB,qBAAa,SAAU,YAAW,MAAM;IACtC,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,SAAS,CAAC;CA4DjD"}
|
|
@@ -31,14 +31,9 @@ class GUISystem {
|
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, GUIComponent_1.ProgressBarComp, ({ entity, component }) => {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
throw Error('ProgressBarComp need SpriteRender');
|
|
37
|
-
const { progress, mode } = component;
|
|
38
|
-
const node = new LoadingBar_1.LoadingBar(mode, spriteComp.node.instance);
|
|
39
|
-
spriteComp.node.instance.mask = node;
|
|
34
|
+
const { progress = 1, bg, fill } = component;
|
|
35
|
+
const node = new ui_1.ProgressBar({ bg, fill, progress });
|
|
40
36
|
component.node = entity.assign(new __1.NodeComp(node, entity));
|
|
41
|
-
node.progress = progress;
|
|
42
37
|
});
|
|
43
38
|
event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, GUIComponent_1.ProgressTimerComp, ({ entity, component }) => {
|
|
44
39
|
// console.log(component, '.progress')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderSystem.d.ts","sourceRoot":"","sources":["../../src/systems/RenderSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,MAAM,EACP,MAAM,YAAY,CAAA;AAOnB,oBAAY,WAAW;IACrB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,KAAK,IAAA;IACL,MAAM,IAAA;IACN,IAAI,IAAA;IACJ,SAAS,IAAA;CACV;AAED,qBAAa,YAAa,YAAW,MAAM;IACzC,SAAS,CAAC,aAAa,EAAE,YAAY;
|
|
1
|
+
{"version":3,"file":"RenderSystem.d.ts","sourceRoot":"","sources":["../../src/systems/RenderSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,MAAM,EACP,MAAM,YAAY,CAAA;AAOnB,oBAAY,WAAW;IACrB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,KAAK,IAAA;IACL,MAAM,IAAA;IACN,IAAI,IAAA;IACJ,SAAS,IAAA;CACV;AAED,qBAAa,YAAa,YAAW,MAAM;IACzC,SAAS,CAAC,aAAa,EAAE,YAAY;CAiDtC"}
|
|
@@ -51,8 +51,9 @@ class RenderSystem {
|
|
|
51
51
|
event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, RenderComponent_1.GraphicsRender, ({ entity, component }) => {
|
|
52
52
|
const { lineWidth, strokeColor, fillColor } = component;
|
|
53
53
|
const node = new pixi_js_1.Graphics();
|
|
54
|
-
node.
|
|
55
|
-
node.
|
|
54
|
+
node.fill(fillColor);
|
|
55
|
+
node.fillStyle = strokeColor;
|
|
56
|
+
node.width = lineWidth;
|
|
56
57
|
component.node = entity.assign(new __1.NodeComp(node, entity));
|
|
57
58
|
// node.drawCircle(0, 0, 100)
|
|
58
59
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@safe-engine/pixi",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@pixi/ui": "^
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
"@pixi/ui": "^2.1.5",
|
|
20
|
+
"entityx-ts": "^2.0.3",
|
|
21
|
+
"@safe-engine/core": "1.0.3",
|
|
22
22
|
"lodash": "^4.17.21",
|
|
23
23
|
"pixi-action-ease": "^1.0.12",
|
|
24
|
-
"pixi.js": "^
|
|
24
|
+
"pixi.js": "^8.4.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/lodash": "^4.17.7",
|
|
@@ -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}}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Constructor } from 'entityx-ts';
|
|
2
|
-
import { Animation } from 'pixi-action-ease';
|
|
3
|
-
import { NodeComp } from './NodeComp';
|
|
4
|
-
export declare class EnhancedComponent {
|
|
5
|
-
constructor(...args: any[]);
|
|
6
|
-
node: NodeComp;
|
|
7
|
-
static hasRender: boolean;
|
|
8
|
-
actionsMap: {
|
|
9
|
-
[key: string]: Animation;
|
|
10
|
-
};
|
|
11
|
-
addComponent<T extends EnhancedComponent>(instance: any): T;
|
|
12
|
-
getComponent<T extends ComponentType>(component: Constructor<T>): T;
|
|
13
|
-
schedule(callback: (dt?: number) => void, interval: number, repeat?: number, delay?: number, key?: string): void;
|
|
14
|
-
unschedule(callback: (arg?: unknown) => void, key?: string): void;
|
|
15
|
-
unscheduleAllCallbacks(): void;
|
|
16
|
-
scheduleOnce(callback: (arg?: unknown) => void, delay: number, key?: string): void;
|
|
17
|
-
getComponentsInChildren<T extends ComponentType>(component: Constructor<T>): T[];
|
|
18
|
-
getComponentInChildren<T extends ComponentType>(component: Constructor<T>): T;
|
|
19
|
-
isEqual(other: EnhancedComponent): boolean;
|
|
20
|
-
}
|
|
21
|
-
export type ComponentType = EnhancedComponent | NodeComp;
|
|
22
|
-
//# sourceMappingURL=EnhancedComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnhancedComponent.d.ts","sourceRoot":"","sources":["../../src/components/EnhancedComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAiB,SAAS,EAAyC,MAAM,kBAAkB,CAAA;AAElG,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,qBAAa,iBAAiB;gBAChB,GAAG,IAAI,EAAE,GAAG,EAAE;IAS1B,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,CAAC,SAAS,UAAO;IACvB,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAK;IAC7C,YAAY,CAAC,CAAC,SAAS,iBAAiB,EAAE,QAAQ,KAAA,GAAG,CAAC;IAGtD,YAAY,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAGnE,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAK,EAAE,KAAK,SAAI,EAAE,GAAG,CAAC,EAAE,MAAM;IAOhG,UAAU,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,MAAM;IAI1D,sBAAsB;IAKtB,YAAY,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAK3E,uBAAuB,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;IAGhF,sBAAsB,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAG7E,OAAO,CAAC,KAAK,EAAE,iBAAiB;CAGjC;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,QAAQ,CAAA"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EnhancedComponent = void 0;
|
|
4
|
-
var pixi_action_ease_1 = require("pixi-action-ease");
|
|
5
|
-
var EnhancedComponent = /** @class */ (function () {
|
|
6
|
-
function EnhancedComponent() {
|
|
7
|
-
var args = [];
|
|
8
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9
|
-
args[_i] = arguments[_i];
|
|
10
|
-
}
|
|
11
|
-
var _this = this;
|
|
12
|
-
this.actionsMap = {};
|
|
13
|
-
var data = args[0];
|
|
14
|
-
if (data) {
|
|
15
|
-
// console.log('constructor', this.constructor.name, data)
|
|
16
|
-
Object.keys(data).forEach(function (key) {
|
|
17
|
-
_this[key] = data[key];
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
EnhancedComponent.prototype.addComponent = function (instance) {
|
|
22
|
-
return this.node.addComponent(instance);
|
|
23
|
-
};
|
|
24
|
-
EnhancedComponent.prototype.getComponent = function (component) {
|
|
25
|
-
return this.node.getComponent(component);
|
|
26
|
-
};
|
|
27
|
-
EnhancedComponent.prototype.schedule = function (callback, interval, repeat, delay, key) {
|
|
28
|
-
if (repeat === void 0) { repeat = -1; }
|
|
29
|
-
if (delay === void 0) { delay = 0; }
|
|
30
|
-
var action = pixi_action_ease_1.Sequence.create(pixi_action_ease_1.DelayTime.create(interval), pixi_action_ease_1.CallFunc.create(callback));
|
|
31
|
-
var repeatAct = pixi_action_ease_1.Repeat.create(action, repeat);
|
|
32
|
-
var seq = pixi_action_ease_1.Sequence.create(pixi_action_ease_1.DelayTime.create(delay), repeatAct);
|
|
33
|
-
var animation = pixi_action_ease_1.actionManager.runAction(this.node.instance, seq);
|
|
34
|
-
this.actionsMap[key] = animation;
|
|
35
|
-
};
|
|
36
|
-
EnhancedComponent.prototype.unschedule = function (callback, key) {
|
|
37
|
-
// this.node.instance.unschedule(callback.bind(this))
|
|
38
|
-
this.actionsMap[key].stop();
|
|
39
|
-
};
|
|
40
|
-
EnhancedComponent.prototype.unscheduleAllCallbacks = function () {
|
|
41
|
-
Object.values(this.actionsMap).forEach(function (action) {
|
|
42
|
-
action.stop();
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
EnhancedComponent.prototype.scheduleOnce = function (callback, delay, key) {
|
|
46
|
-
var action = pixi_action_ease_1.Sequence.create(pixi_action_ease_1.DelayTime.create(delay), pixi_action_ease_1.CallFunc.create(callback));
|
|
47
|
-
var animation = pixi_action_ease_1.actionManager.runAction(this.node.instance, action);
|
|
48
|
-
this.actionsMap[key] = animation;
|
|
49
|
-
};
|
|
50
|
-
EnhancedComponent.prototype.getComponentsInChildren = function (component) {
|
|
51
|
-
return this.node.getComponentsInChildren(component);
|
|
52
|
-
};
|
|
53
|
-
EnhancedComponent.prototype.getComponentInChildren = function (component) {
|
|
54
|
-
return this.node.getComponentInChildren(component);
|
|
55
|
-
};
|
|
56
|
-
EnhancedComponent.prototype.isEqual = function (other) {
|
|
57
|
-
return this.node.entity.id === other.node.entity.id;
|
|
58
|
-
};
|
|
59
|
-
EnhancedComponent.hasRender = true;
|
|
60
|
-
return EnhancedComponent;
|
|
61
|
-
}());
|
|
62
|
-
exports.EnhancedComponent = EnhancedComponent;
|
package/dist/core/Scene.d.ts
DELETED
package/dist/core/Scene.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../src/core/Scene.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAInE,qBAAa,cAAe,SAAQ,iBAAiB;IACnD,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,CAAA;IACvB,MAAM,CAAC,MAAM;CASd"}
|
package/dist/core/Scene.js
DELETED
|
@@ -1,39 +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.SceneComponent = void 0;
|
|
19
|
-
var app_1 = require("../app");
|
|
20
|
-
var EnhancedComponent_1 = require("../components/EnhancedComponent");
|
|
21
|
-
var NodeComp_1 = require("../components/NodeComp");
|
|
22
|
-
var gworld_1 = require("../gworld");
|
|
23
|
-
var SceneComponent = /** @class */ (function (_super) {
|
|
24
|
-
__extends(SceneComponent, _super);
|
|
25
|
-
function SceneComponent() {
|
|
26
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
27
|
-
}
|
|
28
|
-
SceneComponent.create = function () {
|
|
29
|
-
var world = gworld_1.GameWorld.Instance;
|
|
30
|
-
world.entities.reset();
|
|
31
|
-
var root = world.entities.create();
|
|
32
|
-
var node = root.assign(new NodeComp_1.NodeComp(app_1.app.stage, root));
|
|
33
|
-
var sceneComponent = root.assign(new SceneComponent());
|
|
34
|
-
sceneComponent.node = node;
|
|
35
|
-
return sceneComponent;
|
|
36
|
-
};
|
|
37
|
-
return SceneComponent;
|
|
38
|
-
}(EnhancedComponent_1.EnhancedComponent));
|
|
39
|
-
exports.SceneComponent = SceneComponent;
|
package/dist/core/Vec2.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Point } from 'pixi.js';
|
|
2
|
-
declare class _Vec2 extends Point {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
static ZERO: any;
|
|
6
|
-
equals(other: Point): boolean;
|
|
7
|
-
addSelf(value: Point): Point;
|
|
8
|
-
cross(other: Vec2): number;
|
|
9
|
-
signAngle(other: Vec2): number;
|
|
10
|
-
lengthSqr(): number;
|
|
11
|
-
dot(other: Vec2): number;
|
|
12
|
-
angle(other: Vec2): number;
|
|
13
|
-
}
|
|
14
|
-
export type Vec2 = _Vec2;
|
|
15
|
-
export declare function Vec2(x?: number, y?: number): Vec2;
|
|
16
|
-
export declare namespace Vec2 {
|
|
17
|
-
var ZERO: Readonly<_Vec2>;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=Vec2.d.ts.map
|
package/dist/core/Vec2.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Vec2.d.ts","sourceRoot":"","sources":["../../src/core/Vec2.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,cAAM,KAAM,SAAQ,KAAK;IACvB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,MAAM,CAAC,IAAI,MAAA;IAEX,MAAM,CAAC,KAAK,EAAE,KAAK;IAInB,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAOrB,KAAK,CAAC,KAAK,EAAE,IAAI;IAGjB,SAAS,CAAC,KAAK,EAAE,IAAI;IAIrB,SAAS;IAGT,GAAG,CAAC,KAAK,EAAE,IAAI;IAGf,KAAK,CAAC,KAAK,EAAE,IAAI;CAczB;AACD,MAAM,MAAM,IAAI,GAAG,KAAK,CAAA;AACxB,wBAAgB,IAAI,CAAC,CAAC,SAAI,EAAE,CAAC,SAAI,GAAG,IAAI,CAEvC;yBAFe,IAAI"}
|
package/dist/core/Vec2.js
DELETED
|
@@ -1,70 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Vec2 = Vec2;
|
|
22
|
-
var clamp_1 = __importDefault(require("lodash/clamp"));
|
|
23
|
-
var pixi_js_1 = require("pixi.js");
|
|
24
|
-
var _Vec2 = /** @class */ (function (_super) {
|
|
25
|
-
__extends(_Vec2, _super);
|
|
26
|
-
function _Vec2() {
|
|
27
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
28
|
-
}
|
|
29
|
-
_Vec2.prototype.equals = function (other) {
|
|
30
|
-
return this.x === other.x && this.y === other.y;
|
|
31
|
-
};
|
|
32
|
-
_Vec2.prototype.addSelf = function (value) {
|
|
33
|
-
var nor = value.add(new pixi_js_1.Point(this.x, this.y));
|
|
34
|
-
this.x = nor.x;
|
|
35
|
-
this.y = nor.y;
|
|
36
|
-
return nor;
|
|
37
|
-
};
|
|
38
|
-
_Vec2.prototype.cross = function (other) {
|
|
39
|
-
return this.x * other.y - this.y * other.x;
|
|
40
|
-
};
|
|
41
|
-
_Vec2.prototype.signAngle = function (other) {
|
|
42
|
-
var angle = this.angle(other);
|
|
43
|
-
return this.cross(other) < 0 ? -angle : angle;
|
|
44
|
-
};
|
|
45
|
-
_Vec2.prototype.lengthSqr = function () {
|
|
46
|
-
return this.x * this.x + this.y * this.y;
|
|
47
|
-
};
|
|
48
|
-
_Vec2.prototype.dot = function (other) {
|
|
49
|
-
return this.x * other.x + this.y * other.y;
|
|
50
|
-
};
|
|
51
|
-
_Vec2.prototype.angle = function (other) {
|
|
52
|
-
var magSqr1 = this.lengthSqr();
|
|
53
|
-
var magSqr2 = other.lengthSqr();
|
|
54
|
-
if (magSqr1 === 0 || magSqr2 === 0) {
|
|
55
|
-
console.warn('Cant get angle between zero vector');
|
|
56
|
-
return 0.0;
|
|
57
|
-
}
|
|
58
|
-
var dot = this.dot(other);
|
|
59
|
-
var theta = dot / Math.sqrt(magSqr1 * magSqr2);
|
|
60
|
-
theta = (0, clamp_1.default)(theta, -1.0, 1.0);
|
|
61
|
-
return Math.acos(theta);
|
|
62
|
-
};
|
|
63
|
-
return _Vec2;
|
|
64
|
-
}(pixi_js_1.Point));
|
|
65
|
-
function Vec2(x, y) {
|
|
66
|
-
if (x === void 0) { x = 0; }
|
|
67
|
-
if (y === void 0) { y = 0; }
|
|
68
|
-
return new _Vec2(x, y);
|
|
69
|
-
}
|
|
70
|
-
Vec2.ZERO = Object.freeze(Vec2(0, 0));
|
package/dist/core/decorator.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { EnhancedComponent } from '../components/EnhancedComponent';
|
|
2
|
-
export declare class NoRenderComponentX extends EnhancedComponent {
|
|
3
|
-
static hasRender: boolean;
|
|
4
|
-
static create(data?: any): NoRenderComponentX;
|
|
5
|
-
}
|
|
6
|
-
export declare class ComponentX extends EnhancedComponent {
|
|
7
|
-
static create(data?: any): ComponentX;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=decorator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../src/core/decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAGnE,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD,MAAM,CAAC,SAAS,UAAQ;IACxB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG;CAGzB;AAED,qBAAa,UAAW,SAAQ,iBAAiB;IAC/C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG;CAMzB"}
|
package/dist/core/decorator.js
DELETED
|
@@ -1,46 +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.ComponentX = exports.NoRenderComponentX = void 0;
|
|
19
|
-
var EnhancedComponent_1 = require("../components/EnhancedComponent");
|
|
20
|
-
var gworld_1 = require("../gworld");
|
|
21
|
-
var NoRenderComponentX = /** @class */ (function (_super) {
|
|
22
|
-
__extends(NoRenderComponentX, _super);
|
|
23
|
-
function NoRenderComponentX() {
|
|
24
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
25
|
-
}
|
|
26
|
-
NoRenderComponentX.create = function (data) {
|
|
27
|
-
return new this(data);
|
|
28
|
-
};
|
|
29
|
-
NoRenderComponentX.hasRender = false;
|
|
30
|
-
return NoRenderComponentX;
|
|
31
|
-
}(EnhancedComponent_1.EnhancedComponent));
|
|
32
|
-
exports.NoRenderComponentX = NoRenderComponentX;
|
|
33
|
-
var ComponentX = /** @class */ (function (_super) {
|
|
34
|
-
__extends(ComponentX, _super);
|
|
35
|
-
function ComponentX() {
|
|
36
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
37
|
-
}
|
|
38
|
-
ComponentX.create = function (data) {
|
|
39
|
-
var world = gworld_1.GameWorld.Instance;
|
|
40
|
-
var root = world.entities.create();
|
|
41
|
-
var comp = root.assign(new this(data));
|
|
42
|
-
return comp;
|
|
43
|
-
};
|
|
44
|
-
return ComponentX;
|
|
45
|
-
}(EnhancedComponent_1.EnhancedComponent));
|
|
46
|
-
exports.ComponentX = ComponentX;
|
package/dist/gworld.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Constructor, System, World } from 'entityx-ts';
|
|
2
|
-
export declare class GameWorld extends World {
|
|
3
|
-
listUpdate: (System | Constructor<System>)[];
|
|
4
|
-
update(dt: number): void;
|
|
5
|
-
private static _instance;
|
|
6
|
-
static get Instance(): GameWorld;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=gworld.d.ts.map
|
package/dist/gworld.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gworld.d.ts","sourceRoot":"","sources":["../src/gworld.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvD,qBAAa,SAAU,SAAQ,KAAK;IAClC,UAAU,EAAE,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,CAAK;IACjD,MAAM,CAAC,EAAE,EAAE,MAAM;IAMjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAW;IAEnC,WAAkB,QAAQ,cAGzB;CACF"}
|