@combos-fun/renderer-adapter 0.1.15 → 0.1.17

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.
Files changed (2) hide show
  1. package/agent-skill.md +11 -50
  2. 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 adapter types used by `@combos-fun/plugin-renderer` and its 2D renderer plugins. This package is not a game System.
3
+ Pixi v8 adapters for custom 2D renderers. Game code uses `plugin-renderer-*` instead.
4
4
 
5
- ## When to read
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
- Read only for a 2D/Pixi rendering task or when authoring a custom 2D renderer.
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
- import { Sprite } from '@combos-fun/renderer-adapter';
39
- import { Renderer, RendererSystem } from '@combos-fun/plugin-renderer';
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.15",
3
+ "version": "0.1.17",
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",