@combos-fun/plugin-renderer-3d-text 0.0.6 → 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 ADDED
@@ -0,0 +1,27 @@
1
+ # @combos-fun/plugin-renderer-3d-text
2
+
3
+ @combos-fun/plugin-renderer-3d-text — part of the Combos Fun engine monorepo.
4
+
5
+ Keywords: `3d`, `text`, `label`, `troika`, `font`.
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-3d-text/plugin-manifest';
21
+ // or fetch the markdown directly:
22
+ // require.resolve('@combos-fun/plugin-renderer-3d-text/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,63 @@
1
+ # `@combos-fun/plugin-renderer-3d-text` — Agent notes
2
+
3
+ 3D text rendering for the 3D pipeline, backed by `troika-three-text`.
4
+ Suitable for in-world labels, dialogue text, scoreboards.
5
+
6
+ ## When to read
7
+
8
+ Read for any 3D text label: signs, score displays, floating tooltips.
9
+
10
+ ## Public API
11
+
12
+ ```ts
13
+ import { Text3D, Text3DSystem, type Text3DParams } from '@combos-fun/plugin-renderer-3d-text';
14
+ ```
15
+
16
+ `componentName = 'Text3D'`, `systemName = 'Text3DSystem'`.
17
+
18
+ ### `Text3DParams`
19
+
20
+ | Field | Type | Default |
21
+ |-------|------|---------|
22
+ | `text` | `string` | `''` |
23
+ | `fontSize` | `number` | `0.5` |
24
+ | `color` | `number` | `0xffffff` |
25
+ | `anchorX` | `string` | `'center'` |
26
+ | `anchorY` | `string` | `'middle'` |
27
+ | `maxWidth` | `number` | `0` (only applied when `> 0`) |
28
+ | `font` | `string` | `''` (custom font URL when non-empty) |
29
+ | `positionX` / `Y` / `Z` | `number` | `0` |
30
+ | `rotationX` / `Y` / `Z` | `number` | `0` |
31
+
32
+ There are **no scale fields**. Use `fontSize` to control size.
33
+
34
+ ## Required setup
35
+
36
+ `Renderer3DSystem` then `Text3DSystem`. Custom fonts must be reachable
37
+ via the URL specified in `font`.
38
+
39
+ ## Common pitfalls
40
+
41
+ | Symptom | Fix |
42
+ |---------|-----|
43
+ | Text invisible | Empty `text` field, or `color` matching the background |
44
+ | Text not sized | Use `fontSize`, not `scale*` (no scale fields exist) |
45
+ | Wrap not applied | Set `maxWidth > 0` |
46
+ | Custom font not loading | Wait for `troika-three-text` font load before relying on glyph metrics |
47
+
48
+ ## Minimal example
49
+
50
+ ```ts
51
+ const sign = new GameObject('sign');
52
+ sign.addComponent(new Text3D({
53
+ text: 'Welcome',
54
+ fontSize: 0.6,
55
+ color: 0xffffff,
56
+ positionY: 1.5,
57
+ positionZ: -2,
58
+ }));
59
+ ```
60
+
61
+ ## Verification
62
+
63
+ `pnpm --filter @combos-fun/plugin-renderer-3d-text run build`.
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@combos-fun/plugin-renderer-3d-text",
3
+ "pluginId": "renderer-3d-text",
4
+ "category": "rendering",
5
+ "dimension": "3d",
6
+ "isCore": false,
7
+ "keywords": ["3d", "text", "label", "troika", "font"],
8
+ "agentSkill": "./agent-skill.md",
9
+ "requires": ["@combos-fun/engine", "@combos-fun/plugin-renderer-3d"],
10
+ "exports": ["Text3D", "Text3DSystem"]
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/plugin-renderer-3d-text",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "@combos-fun/plugin-renderer-3d-text",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-3d-text.esm.js",
@@ -9,14 +9,28 @@
9
9
  "types": "dist/plugin-renderer-3d-text.d.ts",
10
10
  "files": [
11
11
  "index.js",
12
- "dist"
12
+ "dist",
13
+ "agent-skill.md",
14
+ "combos-plugin.json"
13
15
  ],
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/plugin-renderer-3d-text.esm.js",
19
+ "require": "./index.js",
20
+ "types": "./dist/plugin-renderer-3d-text.d.ts"
21
+ },
22
+ "./plugin-manifest": "./combos-plugin.json",
23
+ "./agent-skill": "./agent-skill.md"
24
+ },
25
+ "combos": {
26
+ "pluginManifest": "./combos-plugin.json"
27
+ },
14
28
  "dependencies": {
15
29
  "three": "^0.172.0",
16
30
  "troika-three-text": "^0.52.3",
17
- "@combos-fun/engine": "0.0.6",
18
- "@combos-fun/plugin-renderer-3d": "0.0.6",
19
- "@combos-fun/inspector-decorator": "0.0.6"
31
+ "@combos-fun/engine": "0.0.7",
32
+ "@combos-fun/plugin-renderer-3d": "0.0.7",
33
+ "@combos-fun/inspector-decorator": "0.0.7"
20
34
  },
21
35
  "scripts": {
22
36
  "build": "node ../../scripts/build-package.mjs"