@combos-fun/plugin-renderer-graphics 0.0.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/README.md +3 -0
- package/dist/plugin-renderer-graphics.cjs.js +52 -0
- package/dist/plugin-renderer-graphics.cjs.js.map +1 -0
- package/dist/plugin-renderer-graphics.cjs.prod.js +1 -0
- package/dist/plugin-renderer-graphics.d.ts +21 -0
- package/dist/plugin-renderer-graphics.esm.js +49 -0
- package/dist/plugin-renderer-graphics.esm.js.map +1 -0
- package/index.js +7 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var engine = require('@combos-fun/engine');
|
|
4
|
+
var rendererAdapter = require('@combos-fun/renderer-adapter');
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var pluginRenderer = require('@combos-fun/plugin-renderer');
|
|
7
|
+
|
|
8
|
+
let Graphics$1 = class Graphics extends engine.Component {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.graphics = null;
|
|
12
|
+
}
|
|
13
|
+
static { this.componentName = 'Graphics'; }
|
|
14
|
+
init() {
|
|
15
|
+
this.graphics = new rendererAdapter.Graphics();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
let Graphics = class Graphics extends pluginRenderer.Renderer {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.name = 'Graphics';
|
|
23
|
+
}
|
|
24
|
+
static { this.systemName = 'Graphics'; }
|
|
25
|
+
init() {
|
|
26
|
+
this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
|
|
27
|
+
this.renderSystem.rendererManager.register(this);
|
|
28
|
+
}
|
|
29
|
+
async componentChanged(changed) {
|
|
30
|
+
if (changed.type === engine.OBSERVER_TYPE.ADD) {
|
|
31
|
+
this.containerManager
|
|
32
|
+
.getContainer(changed.gameObject.id)
|
|
33
|
+
.addChildAt(changed.component.graphics, 0);
|
|
34
|
+
}
|
|
35
|
+
else if (changed.type === engine.OBSERVER_TYPE.REMOVE) {
|
|
36
|
+
this.containerManager
|
|
37
|
+
.getContainer(changed.gameObject.id)
|
|
38
|
+
.removeChild(changed.component.graphics);
|
|
39
|
+
changed.component.graphics.destroy({ children: true });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
Graphics = tslib.__decorate([
|
|
44
|
+
engine.decorators.componentObserver({
|
|
45
|
+
Graphics: ['graphics'],
|
|
46
|
+
})
|
|
47
|
+
], Graphics);
|
|
48
|
+
var Graphics_default = Graphics;
|
|
49
|
+
|
|
50
|
+
exports.Graphics = Graphics$1;
|
|
51
|
+
exports.GraphicsSystem = Graphics_default;
|
|
52
|
+
//# sourceMappingURL=plugin-renderer-graphics.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-renderer-graphics.cjs.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Graphics as GraphicsEngine } from '@combos-fun/renderer-adapter';\n\nexport default class Graphics extends Component {\n static componentName: string = 'Graphics';\n graphics: GraphicsEngine = null;\n init() {\n this.graphics = new GraphicsEngine();\n }\n}\n","import { Renderer, RendererSystem, RendererManager, ContainerManager } from '@combos-fun/plugin-renderer';\nimport { decorators, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport GraphicsComponent from './component';\n\n@decorators.componentObserver({\n Graphics: ['graphics'],\n})\nexport default class Graphics extends Renderer {\n static systemName = 'Graphics';\n\n name = 'Graphics';\n renderSystem: RendererSystem;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n\n init() {\n this.renderSystem = this.game.getSystem(RendererSystem) as RendererSystem;\n this.renderSystem.rendererManager.register(this);\n }\n\n async componentChanged(changed: ComponentChanged) {\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.containerManager\n .getContainer(changed.gameObject.id)\n .addChildAt((changed.component as GraphicsComponent).graphics, 0);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.containerManager\n .getContainer(changed.gameObject.id)\n .removeChild((changed.component as GraphicsComponent).graphics);\n (changed.component as GraphicsComponent).graphics.destroy({ children: true });\n }\n }\n}\n"],"names":["Component","GraphicsEngine","Renderer","RendererSystem","OBSERVER_TYPE","__decorate","decorators"],"mappings":";;;;;;;iBAGc,MAAO,QAAS,SAAQA,gBAAS,CAAA;AAA/C,IAAA,WAAA,GAAA;;QAEE,IAAA,CAAA,QAAQ,GAAmB,IAAI;IAIjC;aALS,IAAA,CAAA,aAAa,GAAW,UAAX,CAAsB;IAE1C,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAIC,wBAAc,EAAE;IACtC;;;ACDa,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQC,uBAAQ,CAAA;AAA/B,IAAA,WAAA,GAAA;;QAGb,IAAA,CAAA,IAAI,GAAG,UAAU;IAsBnB;aAxBS,IAAA,CAAA,UAAU,GAAG,UAAH,CAAc;IAO/B,IAAI,GAAA;QACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAACC,6BAAc,CAAmB;QACzE,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC;IAClD;IAEA,MAAM,gBAAgB,CAAC,OAAyB,EAAA;QAC9C,IAAI,OAAO,CAAC,IAAI,KAAKC,oBAAa,CAAC,GAAG,EAAE;AACtC,YAAA,IAAI,CAAC;AACF,iBAAA,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;iBAClC,UAAU,CAAE,OAAO,CAAC,SAA+B,CAAC,QAAQ,EAAE,CAAC,CAAC;QACrE;aAAO,IAAI,OAAO,CAAC,IAAI,KAAKA,oBAAa,CAAC,MAAM,EAAE;AAChD,YAAA,IAAI,CAAC;AACF,iBAAA,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAClC,iBAAA,WAAW,CAAE,OAAO,CAAC,SAA+B,CAAC,QAAQ,CAAC;AAChE,YAAA,OAAO,CAAC,SAA+B,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC/E;IACF;;AAxBmB,QAAQ,GAAAC,gBAAA,CAAA;IAH5BC,iBAAU,CAAC,iBAAiB,CAAC;QAC5B,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB;AACoB,CAAA,EAAA,QAAQ,CAyB5B;uBAzBoB,QAAQ;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@combos-fun/engine"),r=require("@combos-fun/renderer-adapter"),t=require("tslib"),s=require("@combos-fun/plugin-renderer");let n=class extends e.Component{constructor(){super(...arguments),this.graphics=null}static{this.componentName="Graphics"}init(){this.graphics=new r.Graphics}},i=class extends s.Renderer{constructor(){super(...arguments),this.name="Graphics"}static{this.systemName="Graphics"}init(){this.renderSystem=this.game.getSystem(s.RendererSystem),this.renderSystem.rendererManager.register(this)}async componentChanged(r){r.type===e.OBSERVER_TYPE.ADD?this.containerManager.getContainer(r.gameObject.id).addChildAt(r.component.graphics,0):r.type===e.OBSERVER_TYPE.REMOVE&&(this.containerManager.getContainer(r.gameObject.id).removeChild(r.component.graphics),r.component.graphics.destroy({children:!0}))}};i=t.__decorate([e.decorators.componentObserver({Graphics:["graphics"]})],i);var a=i;exports.Graphics=n,exports.GraphicsSystem=a;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component, ComponentChanged } from '@combos-fun/engine';
|
|
2
|
+
import { Graphics as Graphics$2 } from '@combos-fun/renderer-adapter';
|
|
3
|
+
import { Renderer, RendererSystem, RendererManager, ContainerManager } from '@combos-fun/plugin-renderer';
|
|
4
|
+
|
|
5
|
+
declare class Graphics$1 extends Component {
|
|
6
|
+
static componentName: string;
|
|
7
|
+
graphics: Graphics$2;
|
|
8
|
+
init(): void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare class Graphics extends Renderer {
|
|
12
|
+
static systemName: string;
|
|
13
|
+
name: string;
|
|
14
|
+
renderSystem: RendererSystem;
|
|
15
|
+
rendererManager: RendererManager;
|
|
16
|
+
containerManager: ContainerManager;
|
|
17
|
+
init(): void;
|
|
18
|
+
componentChanged(changed: ComponentChanged): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Graphics$1 as Graphics, Graphics as GraphicsSystem };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Component, OBSERVER_TYPE, decorators } from '@combos-fun/engine';
|
|
2
|
+
import { Graphics as Graphics$2 } from '@combos-fun/renderer-adapter';
|
|
3
|
+
import { __decorate } from 'tslib';
|
|
4
|
+
import { Renderer, RendererSystem } from '@combos-fun/plugin-renderer';
|
|
5
|
+
|
|
6
|
+
let Graphics$1 = class Graphics extends Component {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.graphics = null;
|
|
10
|
+
}
|
|
11
|
+
static { this.componentName = 'Graphics'; }
|
|
12
|
+
init() {
|
|
13
|
+
this.graphics = new Graphics$2();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
let Graphics = class Graphics extends Renderer {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.name = 'Graphics';
|
|
21
|
+
}
|
|
22
|
+
static { this.systemName = 'Graphics'; }
|
|
23
|
+
init() {
|
|
24
|
+
this.renderSystem = this.game.getSystem(RendererSystem);
|
|
25
|
+
this.renderSystem.rendererManager.register(this);
|
|
26
|
+
}
|
|
27
|
+
async componentChanged(changed) {
|
|
28
|
+
if (changed.type === OBSERVER_TYPE.ADD) {
|
|
29
|
+
this.containerManager
|
|
30
|
+
.getContainer(changed.gameObject.id)
|
|
31
|
+
.addChildAt(changed.component.graphics, 0);
|
|
32
|
+
}
|
|
33
|
+
else if (changed.type === OBSERVER_TYPE.REMOVE) {
|
|
34
|
+
this.containerManager
|
|
35
|
+
.getContainer(changed.gameObject.id)
|
|
36
|
+
.removeChild(changed.component.graphics);
|
|
37
|
+
changed.component.graphics.destroy({ children: true });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
Graphics = __decorate([
|
|
42
|
+
decorators.componentObserver({
|
|
43
|
+
Graphics: ['graphics'],
|
|
44
|
+
})
|
|
45
|
+
], Graphics);
|
|
46
|
+
var Graphics_default = Graphics;
|
|
47
|
+
|
|
48
|
+
export { Graphics$1 as Graphics, Graphics_default as GraphicsSystem };
|
|
49
|
+
//# sourceMappingURL=plugin-renderer-graphics.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-renderer-graphics.esm.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Graphics as GraphicsEngine } from '@combos-fun/renderer-adapter';\n\nexport default class Graphics extends Component {\n static componentName: string = 'Graphics';\n graphics: GraphicsEngine = null;\n init() {\n this.graphics = new GraphicsEngine();\n }\n}\n","import { Renderer, RendererSystem, RendererManager, ContainerManager } from '@combos-fun/plugin-renderer';\nimport { decorators, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport GraphicsComponent from './component';\n\n@decorators.componentObserver({\n Graphics: ['graphics'],\n})\nexport default class Graphics extends Renderer {\n static systemName = 'Graphics';\n\n name = 'Graphics';\n renderSystem: RendererSystem;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n\n init() {\n this.renderSystem = this.game.getSystem(RendererSystem) as RendererSystem;\n this.renderSystem.rendererManager.register(this);\n }\n\n async componentChanged(changed: ComponentChanged) {\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.containerManager\n .getContainer(changed.gameObject.id)\n .addChildAt((changed.component as GraphicsComponent).graphics, 0);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.containerManager\n .getContainer(changed.gameObject.id)\n .removeChild((changed.component as GraphicsComponent).graphics);\n (changed.component as GraphicsComponent).graphics.destroy({ children: true });\n }\n }\n}\n"],"names":["GraphicsEngine"],"mappings":";;;;;iBAGc,MAAO,QAAS,SAAQ,SAAS,CAAA;AAA/C,IAAA,WAAA,GAAA;;QAEE,IAAA,CAAA,QAAQ,GAAmB,IAAI;IAIjC;aALS,IAAA,CAAA,aAAa,GAAW,UAAX,CAAsB;IAE1C,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAIA,UAAc,EAAE;IACtC;;;ACDa,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,QAAQ,CAAA;AAA/B,IAAA,WAAA,GAAA;;QAGb,IAAA,CAAA,IAAI,GAAG,UAAU;IAsBnB;aAxBS,IAAA,CAAA,UAAU,GAAG,UAAH,CAAc;IAO/B,IAAI,GAAA;QACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAmB;QACzE,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC;IAClD;IAEA,MAAM,gBAAgB,CAAC,OAAyB,EAAA;QAC9C,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,CAAC,GAAG,EAAE;AACtC,YAAA,IAAI,CAAC;AACF,iBAAA,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;iBAClC,UAAU,CAAE,OAAO,CAAC,SAA+B,CAAC,QAAQ,EAAE,CAAC,CAAC;QACrE;aAAO,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,CAAC,MAAM,EAAE;AAChD,YAAA,IAAI,CAAC;AACF,iBAAA,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAClC,iBAAA,WAAW,CAAE,OAAO,CAAC,SAA+B,CAAC,QAAQ,CAAC;AAChE,YAAA,OAAO,CAAC,SAA+B,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC/E;IACF;;AAxBmB,QAAQ,GAAA,UAAA,CAAA;IAH5B,UAAU,CAAC,iBAAiB,CAAC;QAC5B,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB;AACoB,CAAA,EAAA,QAAQ,CAyB5B;uBAzBoB,QAAQ;;;;"}
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@combos-fun/plugin-renderer-graphics",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "@combos-fun/plugin-renderer-graphics",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "dist/plugin-renderer-graphics.esm.js",
|
|
7
|
+
"bundle": "CombosFun.plugin.renderer.graphics",
|
|
8
|
+
"unpkg": "dist/CombosFun.plugin.renderer.graphics.min.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"index.js",
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"types": "dist/plugin-renderer-graphics.d.ts",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"combos-fun",
|
|
16
|
+
"game"
|
|
17
|
+
],
|
|
18
|
+
"author": "sun668 <q947692259@gmail.com>",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@combos-fun/renderer-adapter": "0.0.1",
|
|
21
|
+
"@combos-fun/plugin-renderer": "0.0.1",
|
|
22
|
+
"@combos-fun/engine": "0.0.1"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "node ../../scripts/build-package.mjs"
|
|
26
|
+
}
|
|
27
|
+
}
|