@combos-fun/plugin-renderer-graphics 0.0.5 → 0.0.7

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 CHANGED
@@ -1,3 +1,27 @@
1
1
  # @combos-fun/plugin-renderer-graphics
2
2
 
3
- Internal workspace package (Combos Fun monorepo).
3
+ @combos-fun/plugin-renderer-graphics part of the Combos Fun engine monorepo.
4
+
5
+ Keywords: `graphics`, `vector`, `shape`, `fill`, `stroke`, `2d`.
6
+
7
+ ## Documentation
8
+
9
+ - Per-package agent / developer notes: [`agent-skill.md`](./agent-skill.md)
10
+ - Machine-readable manifest: [`combos-plugin.json`](./combos-plugin.json)
11
+ (validated against `schemas/combos-plugin.schema.json` in the repo
12
+ root)
13
+ - Entry skill (single source of truth for AI agents working with this
14
+ monorepo): `skills/combos-engine-development/SKILL.md`
15
+
16
+ When consumed from npm, the manifest and agent notes are exposed as
17
+ stable subpaths:
18
+
19
+ ```ts
20
+ import manifest from '@combos-fun/plugin-renderer-graphics/plugin-manifest';
21
+ // or fetch the markdown directly:
22
+ // require.resolve('@combos-fun/plugin-renderer-graphics/agent-skill')
23
+ ```
24
+
25
+ ## License
26
+
27
+ Internal workspace package, part of the Combos Fun engine monorepo.
package/agent-skill.md ADDED
@@ -0,0 +1,50 @@
1
+ # `@combos-fun/plugin-renderer-graphics` — Agent notes
2
+
3
+ Vector / procedural shapes for the 2D pipeline. The Component exposes a
4
+ Pixi `Graphics` API for free-form drawing on the GameObject's container.
5
+
6
+ ## When to read
7
+
8
+ Read for any vector shape: lines, fills, custom geometry, circles /
9
+ rectangles drawn on demand.
10
+
11
+ ## Public API
12
+
13
+ ```ts
14
+ import { Graphics, GraphicsSystem } from '@combos-fun/plugin-renderer-graphics';
15
+ ```
16
+
17
+ `componentName = 'Graphics'`, `systemName = 'GraphicsSystem'`.
18
+
19
+ The `Graphics` Component owns a `graphics` field — a Pixi `Graphics`
20
+ instance created in `init()`. Use the standard Pixi v8 graphics API
21
+ (`rect`, `circle`, `fill`, `stroke`, `moveTo`, `lineTo`, etc.) on it.
22
+
23
+ ## Required setup
24
+
25
+ `RendererSystem` then `GraphicsSystem`.
26
+
27
+ ## Common pitfalls
28
+
29
+ | Symptom | Fix |
30
+ |---------|-----|
31
+ | Nothing drawn | Call `comp.graphics.fill(...)` / `stroke(...)` after path commands; Pixi v8 requires explicit fill/stroke |
32
+ | Drawing only first frame | Pixi `Graphics` is retained — calling `.clear()` then redrawing is needed for dynamic shapes |
33
+ | Performance regression | For static shapes prefer `Img` or `Sprite`; `Graphics` is for dynamic vector content |
34
+
35
+ ## Minimal example
36
+
37
+ ```ts
38
+ const go = new GameObject('rect');
39
+ go.addComponent(new Transform({ position: { x: 100, y: 100 } }));
40
+ const g = go.addComponent(new Graphics());
41
+ g.graphics.rect(0, 0, 200, 80).fill({ color: 0xff0000 });
42
+ ```
43
+
44
+ (Note: keeping the `addComponent` return is for **demo purposes only**;
45
+ inside real Components, use `gameObject.getComponent(Graphics)` from a
46
+ lifecycle hook.)
47
+
48
+ ## Verification
49
+
50
+ `pnpm --filter @combos-fun/plugin-renderer-graphics run build`.
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@combos-fun/plugin-renderer-graphics",
3
+ "pluginId": "renderer-graphics",
4
+ "category": "rendering",
5
+ "dimension": "2d",
6
+ "isCore": false,
7
+ "keywords": ["graphics", "vector", "shape", "fill", "stroke", "2d"],
8
+ "agentSkill": "./agent-skill.md",
9
+ "requires": ["@combos-fun/engine", "@combos-fun/plugin-renderer"],
10
+ "exports": ["Graphics", "GraphicsSystem"]
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/plugin-renderer-graphics",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "@combos-fun/plugin-renderer-graphics",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-graphics.esm.js",
@@ -8,8 +8,22 @@
8
8
  "unpkg": "dist/CombosFun.plugin.renderer.graphics.min.js",
9
9
  "files": [
10
10
  "index.js",
11
- "dist"
11
+ "dist",
12
+ "agent-skill.md",
13
+ "combos-plugin.json"
12
14
  ],
15
+ "exports": {
16
+ ".": {
17
+ "import": "./dist/plugin-renderer-graphics.esm.js",
18
+ "require": "./index.js",
19
+ "types": "./dist/plugin-renderer-graphics.d.ts"
20
+ },
21
+ "./plugin-manifest": "./combos-plugin.json",
22
+ "./agent-skill": "./agent-skill.md"
23
+ },
24
+ "combos": {
25
+ "pluginManifest": "./combos-plugin.json"
26
+ },
13
27
  "types": "dist/plugin-renderer-graphics.d.ts",
14
28
  "keywords": [
15
29
  "combos-fun",
@@ -17,9 +31,9 @@
17
31
  ],
18
32
  "author": "sun668 <q947692259@gmail.com>",
19
33
  "dependencies": {
20
- "@combos-fun/renderer-adapter": "0.0.5",
21
- "@combos-fun/plugin-renderer": "0.0.5",
22
- "@combos-fun/engine": "0.0.5"
34
+ "@combos-fun/renderer-adapter": "0.0.7",
35
+ "@combos-fun/plugin-renderer": "0.0.7",
36
+ "@combos-fun/engine": "0.0.7"
23
37
  },
24
38
  "scripts": {
25
39
  "build": "node ../../scripts/build-package.mjs"