@combos-fun/renderer-adapter 0.1.14 → 0.1.16
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 +11 -50
- package/package.json +1 -1
package/agent-skill.md
CHANGED
|
@@ -1,57 +1,18 @@
|
|
|
1
1
|
# `@combos-fun/renderer-adapter` — Agent notes
|
|
2
2
|
|
|
3
|
-
Pixi v8
|
|
3
|
+
Pixi v8 adapters for custom 2D renderers. Game code uses `plugin-renderer-*` instead.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
| Export | Pass to `addChild` |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `Application` | Pixi re-export, not a child |
|
|
8
|
+
| `Container`, `Graphics`, `Text`, `NinePatch` | the adapter |
|
|
9
|
+
| `Sprite` | `sprite.sprite` |
|
|
10
|
+
| `TilingSprite` | `tilingSprite.tilingSprite` |
|
|
11
|
+
| `SpriteAnimation` | `spriteAnimation.animatedSprite` |
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Public API
|
|
10
|
-
|
|
11
|
-
| Export | Shape | Pass to `addChild` |
|
|
12
|
-
|---|---|---|
|
|
13
|
-
| `Application` | Pixi re-export | — |
|
|
14
|
-
| `Container`, `Graphics`, `Text`, `NinePatch` | Pixi subclasses | adapter instance |
|
|
15
|
-
| `Sprite` | composition | `sprite.sprite` |
|
|
16
|
-
| `TilingSprite` | composition | `tilingSprite.tilingSprite` |
|
|
17
|
-
| `SpriteAnimation` | composition | `spriteAnimation.animatedSprite` |
|
|
18
|
-
|
|
19
|
-
End users normally consume higher-level renderer plugins rather than these adapters.
|
|
20
|
-
|
|
21
|
-
## Required setup
|
|
22
|
-
|
|
23
|
-
None for ordinary game code; `plugin-renderer` loads the adapter transitively.
|
|
24
|
-
|
|
25
|
-
## Runtime behaviour
|
|
26
|
-
|
|
27
|
-
Custom 2D renderer plugins extend `Renderer`, register with `RendererSystem.rendererManager`, and use adapter display objects with `containerManager.getContainer(gameObject.id)`.
|
|
28
|
-
|
|
29
|
-
## Common pitfalls
|
|
30
|
-
|
|
31
|
-
- Do not import `pixi.js` directly in a custom 2D renderer plugin.
|
|
32
|
-
- A composition adapter is not itself displayable; add its inner Pixi object.
|
|
33
|
-
- Do not mix raw Pixi containers with adapter containers.
|
|
34
|
-
|
|
35
|
-
## Minimal example
|
|
13
|
+
`plugin-renderer` loads this package. Extend `Renderer`, then `this.game.getSystem(RendererSystem).rendererManager.register(this)`, and attach under `containerManager.getContainer(gameObject.id)`. Do not import `pixi.js`. Do not mix raw Pixi containers with adapter containers.
|
|
36
14
|
|
|
37
15
|
```ts
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class MyRenderer extends Renderer {
|
|
42
|
-
init() {
|
|
43
|
-
this.game.getSystem(RendererSystem).rendererManager.register(this);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
add(gameObject, texture) {
|
|
47
|
-
const sprite = new Sprite(texture);
|
|
48
|
-
this.containerManager.getContainer(gameObject.id).addChild(sprite.sprite);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
16
|
+
const sprite = new Sprite(texture);
|
|
17
|
+
this.containerManager.getContainer(gameObject.id).addChild(sprite.sprite);
|
|
51
18
|
```
|
|
52
|
-
|
|
53
|
-
Subclass adapters use `container.addChild(new Graphics())` directly.
|
|
54
|
-
|
|
55
|
-
## Verification
|
|
56
|
-
|
|
57
|
-
Run `pnpm --filter @combos-fun/renderer-adapter run build`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/renderer-adapter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Pixi v8 display-object adapter layer used by @combos-fun/plugin-renderer and its 2D rendering sub-plugins",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/renderer-adapter.esm.js",
|