@combos-fun/plugin-renderer-3d-sprite-animation 0.1.15 → 0.1.16
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/agent-skill.md +12 -52
- package/package.json +4 -4
package/agent-skill.md
CHANGED
|
@@ -1,63 +1,23 @@
|
|
|
1
1
|
# `@combos-fun/plugin-renderer-3d-sprite-animation` — Agent notes
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Prerequisite: follow the parent `@combos-fun/plugin-renderer-3d` skill for system order, named resources, pose seeding, hierarchy, and stale-async handling.
|
|
6
|
-
|
|
7
|
-
## Public API
|
|
3
|
+
Spritesheet on a double-sided plane. Parent: `plugin-renderer-3d`. No `play` / `stop` / `gotoAndPlay`.
|
|
8
4
|
|
|
9
5
|
```ts
|
|
10
|
-
import {
|
|
11
|
-
SpriteAnimation3D,
|
|
12
|
-
SpriteAnimation3DSystem,
|
|
13
|
-
type SpriteAnimation3DParams,
|
|
14
|
-
} from '@combos-fun/plugin-renderer-3d-sprite-animation';
|
|
6
|
+
import { SpriteAnimation3D, SpriteAnimation3DSystem } from '@combos-fun/plugin-renderer-3d-sprite-animation';
|
|
15
7
|
```
|
|
16
8
|
|
|
17
|
-
`componentName = 'SpriteAnimation3D'
|
|
18
|
-
|
|
19
|
-
## Parameters
|
|
20
|
-
|
|
21
|
-
| Field | Type | Default |
|
|
22
|
-
|-------|------|---------|
|
|
23
|
-
| `resource` | `string` | `''`; empty on ADD is a silent no-op |
|
|
24
|
-
| `autoPlay` | `boolean` | `true` |
|
|
25
|
-
| `speed` | `number` | `100` milliseconds per frame |
|
|
26
|
-
| `positionX/Y/Z` | `number` | `0` |
|
|
27
|
-
| `rotationX/Y/Z` | `number` | `0` radians |
|
|
28
|
-
| `scaleX/Y` | `number` | `1` |
|
|
29
|
-
|
|
30
|
-
There is no `scaleZ` and no public `play()`, `stop()`, or `gotoAndPlay()`.
|
|
31
|
-
|
|
32
|
-
## Resource and lifecycle
|
|
33
|
-
|
|
34
|
-
A `SPRITE_ANIMATION` resource needs both `src.image` and `src.json`. The system reads `data.image` and a top-level `data.json.frames`; `meta.size` is optional and falls back to image dimensions. It creates its own Three texture and does not overwrite the Pixi resource instance.
|
|
9
|
+
`componentName = 'SpriteAnimation3D'`. `systemName = 'SpriteAnimation3DSystem'`.
|
|
35
10
|
|
|
36
|
-
|
|
11
|
+
| Field | Default |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `resource` | `''` — `SPRITE_ANIMATION` name. Empty on add does nothing |
|
|
14
|
+
| `autoPlay` | `true` — only when the sheet loads |
|
|
15
|
+
| `speed` | `100` — milliseconds per frame, read every frame |
|
|
16
|
+
| `position*` / `rotation*` | `0` |
|
|
17
|
+
| `scaleX` / `scaleY` | `1` |
|
|
37
18
|
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
The first frame determines plane aspect ratio. Array frames retain array order; object-map frame keys are sorted lexically.
|
|
41
|
-
|
|
42
|
-
## Package-specific pitfalls
|
|
43
|
-
|
|
44
|
-
- Missing JSON, missing frames, or malformed `{ frame: { x, y, w, h } }` entries fail loading.
|
|
45
|
-
- A one-frame sheet appears static.
|
|
46
|
-
- Use an array when lexical filename sorting is not the desired sequence.
|
|
47
|
-
- `speed` is a frame duration, not an FPS multiplier.
|
|
48
|
-
|
|
49
|
-
## Minimal example
|
|
19
|
+
No `scaleZ`. Resource needs `src.image` and `src.json` with top-level `frames` (`{ frame: { x, y, w, h } }`). `meta.size` falls back to the image size. Array frames keep array order; object keys are sorted lexically. Plane aspect comes from the first frame. The texture is its own Three texture. Load is async and validates before attach. Missing or malformed frames fail the load.
|
|
50
20
|
|
|
51
21
|
```ts
|
|
52
|
-
|
|
53
|
-
fx.addComponent(new SpriteAnimation3D({
|
|
54
|
-
resource: 'explosion',
|
|
55
|
-
autoPlay: true,
|
|
56
|
-
speed: 80,
|
|
57
|
-
positionZ: -1,
|
|
58
|
-
}));
|
|
22
|
+
fx.addComponent(new SpriteAnimation3D({ resource: 'explosion', speed: 80, positionZ: -1 }));
|
|
59
23
|
```
|
|
60
|
-
|
|
61
|
-
## Verification
|
|
62
|
-
|
|
63
|
-
`pnpm --filter @combos-fun/plugin-renderer-3d-sprite-animation run build`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/plugin-renderer-3d-sprite-animation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Spritesheet animation projected onto a PlaneGeometry in 3D space",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-3d-sprite-animation.esm.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"three": "^0.172.0",
|
|
30
|
-
"@combos-fun/engine": "0.1.
|
|
31
|
-
"@combos-fun/inspector-decorator": "0.1.
|
|
32
|
-
"@combos-fun/plugin-renderer-3d": "0.1.
|
|
30
|
+
"@combos-fun/engine": "0.1.16",
|
|
31
|
+
"@combos-fun/inspector-decorator": "0.1.16",
|
|
32
|
+
"@combos-fun/plugin-renderer-3d": "0.1.16"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"combos-fun",
|