@combos-fun/plugin-renderer-3d-sprite-animation 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 +27 -0
- package/agent-skill.md +63 -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-sprite-animation
|
|
2
|
+
|
|
3
|
+
@combos-fun/plugin-renderer-3d-sprite-animation — part of the Combos Fun engine monorepo.
|
|
4
|
+
|
|
5
|
+
Keywords: `3d`, `sprite`, `animation`, `spritesheet`, `uv`, `billboard`.
|
|
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-sprite-animation/plugin-manifest';
|
|
21
|
+
// or fetch the markdown directly:
|
|
22
|
+
// require.resolve('@combos-fun/plugin-renderer-3d-sprite-animation/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-sprite-animation` — Agent notes
|
|
2
|
+
|
|
3
|
+
Spritesheet animation projected onto a `PlaneGeometry` in 3D space.
|
|
4
|
+
Animates UV offsets each frame to flip through frames from a Texture Packer
|
|
5
|
+
JSON sheet.
|
|
6
|
+
|
|
7
|
+
## When to read
|
|
8
|
+
|
|
9
|
+
Read for any 2D-styled animation in a 3D scene: power-up effects, FX
|
|
10
|
+
sprites, animated billboards, decals.
|
|
11
|
+
|
|
12
|
+
## Public API
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { SpriteAnimation3D, SpriteAnimation3DSystem, type SpriteAnimation3DParams } from '@combos-fun/plugin-renderer-3d-sprite-animation';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`componentName = 'SpriteAnimation3D'`,
|
|
19
|
+
`systemName = 'SpriteAnimation3DSystem'`.
|
|
20
|
+
|
|
21
|
+
### `SpriteAnimation3DParams`
|
|
22
|
+
|
|
23
|
+
| Field | Type | Default |
|
|
24
|
+
|-------|------|---------|
|
|
25
|
+
| `resource` | `string` | `''` (Texture Packer JSON URL — direct) |
|
|
26
|
+
| `autoPlay` | `boolean` | `true` |
|
|
27
|
+
| `speed` | `number` | `100` (ms per frame) |
|
|
28
|
+
| `positionX` / `Y` / `Z` | `number` | `0` |
|
|
29
|
+
| `rotationX` / `Y` / `Z` | `number` | `0` |
|
|
30
|
+
| `scaleX` / `Y` | `number` | `1` (no `scaleZ` — plane is 2D) |
|
|
31
|
+
|
|
32
|
+
The system loads the spritesheet JSON (array or hash format) and resolves
|
|
33
|
+
the image URL **relative to the JSON path**.
|
|
34
|
+
|
|
35
|
+
## Required setup
|
|
36
|
+
|
|
37
|
+
`Renderer3DSystem` then `SpriteAnimation3DSystem`. The JSON must reference
|
|
38
|
+
a co-located image file.
|
|
39
|
+
|
|
40
|
+
## Common pitfalls
|
|
41
|
+
|
|
42
|
+
| Symptom | Fix |
|
|
43
|
+
|---------|-----|
|
|
44
|
+
| Animation never starts | `autoPlay` defaults to `true`; if you set `false`, drive `play()` from a Component lifecycle hook |
|
|
45
|
+
| Black plane | Image not loaded — verify the JSON's `image`/`meta.image` field resolves correctly relative to the JSON URL |
|
|
46
|
+
| Frames in wrong order | Texture Packer hash format may not preserve order; export as array format |
|
|
47
|
+
| Stuck on first frame | Single-frame sheet; verify the JSON contains multiple frame entries |
|
|
48
|
+
|
|
49
|
+
## Minimal example
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
const fx = new GameObject('explosion');
|
|
53
|
+
fx.addComponent(new SpriteAnimation3D({
|
|
54
|
+
resource: '/assets/explosion.json',
|
|
55
|
+
autoPlay: true,
|
|
56
|
+
speed: 80,
|
|
57
|
+
positionZ: -1,
|
|
58
|
+
}));
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Verification
|
|
62
|
+
|
|
63
|
+
`pnpm --filter @combos-fun/plugin-renderer-3d-sprite-animation run build`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@combos-fun/plugin-renderer-3d-sprite-animation",
|
|
3
|
+
"pluginId": "renderer-3d-sprite-animation",
|
|
4
|
+
"category": "rendering",
|
|
5
|
+
"dimension": "3d",
|
|
6
|
+
"isCore": false,
|
|
7
|
+
"keywords": ["3d", "sprite", "animation", "spritesheet", "uv", "billboard"],
|
|
8
|
+
"agentSkill": "./agent-skill.md",
|
|
9
|
+
"requires": ["@combos-fun/engine", "@combos-fun/plugin-renderer-3d"],
|
|
10
|
+
"exports": ["SpriteAnimation3D", "SpriteAnimation3DSystem"]
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/plugin-renderer-3d-sprite-animation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "@combos-fun/plugin-renderer-3d-sprite-animation",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-3d-sprite-animation.esm.js",
|
|
@@ -9,13 +9,27 @@
|
|
|
9
9
|
"types": "dist/plugin-renderer-3d-sprite-animation.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-sprite-animation.esm.js",
|
|
19
|
+
"require": "./index.js",
|
|
20
|
+
"types": "./dist/plugin-renderer-3d-sprite-animation.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
|
-
"@combos-fun/
|
|
17
|
-
"@combos-fun/
|
|
18
|
-
"@combos-fun/
|
|
30
|
+
"@combos-fun/engine": "0.0.7",
|
|
31
|
+
"@combos-fun/inspector-decorator": "0.0.7",
|
|
32
|
+
"@combos-fun/plugin-renderer-3d": "0.0.7"
|
|
19
33
|
},
|
|
20
34
|
"scripts": {
|
|
21
35
|
"build": "node ../../scripts/build-package.mjs"
|