@combos-fun/plugin-renderer 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-skill.md +7 -20
- package/package.json +10 -5
package/agent-skill.md
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
# `@combos-fun/plugin-renderer` — Agent notes
|
|
2
2
|
|
|
3
|
-
2D rendering foundation for Combos Fun. Wraps Pixi v8 via
|
|
4
|
-
`@combos-fun/renderer-adapter` and exposes the `RendererSystem`,
|
|
5
|
-
`Renderer` base class, and the `containerManager` / `rendererManager`
|
|
6
|
-
machinery that all 2D rendering sub-plugins extend.
|
|
3
|
+
2D rendering foundation for Combos Fun. Wraps Pixi v8 via `@combos-fun/renderer-adapter` and exposes the `RendererSystem`, `Renderer` base class, and the `containerManager` / `rendererManager` machinery that all 2D rendering sub-plugins extend.
|
|
7
4
|
|
|
8
5
|
## When to read
|
|
9
6
|
|
|
10
|
-
Read for any 2D rendering task: setting up a canvas, blank-canvas
|
|
11
|
-
debugging, custom 2D renderer plugins, `Container` parenting / sorting.
|
|
12
|
-
All `plugin-renderer-*` 2D sub-plugins assume this file is already
|
|
13
|
-
loaded.
|
|
7
|
+
Read for any 2D rendering task: setting up a canvas, blank-canvas debugging, custom 2D renderer plugins, `Container` parenting / sorting. All `plugin-renderer-*` 2D sub-plugins assume this file is already loaded.
|
|
14
8
|
|
|
15
9
|
## Public API
|
|
16
10
|
|
|
@@ -38,8 +32,7 @@ import {
|
|
|
38
32
|
| `enableScroll` | `boolean` | `false` | |
|
|
39
33
|
| `renderType` | `RENDERER_TYPE` | `UNKNOWN` | `WEBGL`, `CANVAS`, or `UNKNOWN` |
|
|
40
34
|
|
|
41
|
-
System exposes `rendererManager` (collects all `Renderer` subclasses) and
|
|
42
|
-
`containerManager` (per-`GameObject.id` Pixi `Container`).
|
|
35
|
+
System exposes `rendererManager` (collects all `Renderer` subclasses) and `containerManager` (per-`GameObject.id` Pixi `Container`).
|
|
43
36
|
|
|
44
37
|
### `Renderer` base class
|
|
45
38
|
|
|
@@ -52,20 +45,15 @@ Extend this for any custom 2D rendering plugin. Required overrides:
|
|
|
52
45
|
`this.rendererSystem.containerManager.getContainer(gameObject.id)`.
|
|
53
46
|
- `rendererUpdate(gameObject)` — per-frame sync (transform, alpha, etc.).
|
|
54
47
|
|
|
55
|
-
Combine with `@decorators.componentObserver({ MyFeature: ['prop'] })` from
|
|
56
|
-
`@combos-fun/engine`.
|
|
48
|
+
Combine with `@decorators.componentObserver({ MyFeature: ['prop'] })` from `@combos-fun/engine`.
|
|
57
49
|
|
|
58
50
|
### `containerManager.getContainer(gameObject.id)`
|
|
59
51
|
|
|
60
|
-
Returns the per-GameObject `Container` from `@combos-fun/renderer-adapter`.
|
|
61
|
-
Always parent your display objects under this container, never directly to
|
|
62
|
-
the Pixi stage.
|
|
52
|
+
Returns the per-GameObject `Container` from `@combos-fun/renderer-adapter`. Always parent your display objects under this container, never directly to the Pixi stage.
|
|
63
53
|
|
|
64
54
|
## Required setup
|
|
65
55
|
|
|
66
|
-
`RendererSystem` **must** be the first system (or among the first) added to
|
|
67
|
-
`Game.systems`, before any other 2D rendering / event / a11y sub-system that
|
|
68
|
-
calls `getSystem(RendererSystem)` in `init`.
|
|
56
|
+
`RendererSystem` **must** be the first system (or among the first) added to `Game.systems`, before any other 2D rendering / event / a11y sub-system that calls `getSystem(RendererSystem)` in `init`.
|
|
69
57
|
|
|
70
58
|
Typical 2D system order:
|
|
71
59
|
|
|
@@ -121,8 +109,7 @@ new Game({
|
|
|
121
109
|
});
|
|
122
110
|
```
|
|
123
111
|
|
|
124
|
-
This alone is just an empty Pixi stage. Add `plugin-renderer-render`,
|
|
125
|
-
`plugin-renderer-img`, etc. and matching components to render anything.
|
|
112
|
+
This alone is just an empty Pixi stage. Add `plugin-renderer-render`, `plugin-renderer-img`, etc. and matching components to render anything.
|
|
126
113
|
|
|
127
114
|
## Verification
|
|
128
115
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/plugin-renderer",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.9",
|
|
4
|
+
"description": "2D rendering foundation",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer.esm.js",
|
|
7
7
|
"bundle": "CombosFun.plugin.renderer",
|
|
@@ -27,7 +27,12 @@
|
|
|
27
27
|
"types": "dist/plugin-renderer.d.ts",
|
|
28
28
|
"keywords": [
|
|
29
29
|
"combos-fun",
|
|
30
|
-
"
|
|
30
|
+
"pixi",
|
|
31
|
+
"rendering",
|
|
32
|
+
"canvas",
|
|
33
|
+
"2d",
|
|
34
|
+
"renderer-base",
|
|
35
|
+
"container"
|
|
31
36
|
],
|
|
32
37
|
"author": "sun668 <q947692259@gmail.com>",
|
|
33
38
|
"dependencies": {
|
|
@@ -35,8 +40,8 @@
|
|
|
35
40
|
"lodash-es": "^4.17.21",
|
|
36
41
|
"pixi.js": "^8.18.1",
|
|
37
42
|
"resource-loader": "^4.0.0-rc4",
|
|
38
|
-
"@combos-fun/renderer-adapter": "0.0.
|
|
39
|
-
"@combos-fun/engine": "0.0.
|
|
43
|
+
"@combos-fun/renderer-adapter": "0.0.9",
|
|
44
|
+
"@combos-fun/engine": "0.0.9"
|
|
40
45
|
},
|
|
41
46
|
"scripts": {
|
|
42
47
|
"build": "node ../../scripts/build-package.mjs"
|