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