@combos-fun/plugin-renderer-sprite 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 +3 -21
- package/package.json +5 -5
package/agent-skill.md
CHANGED
|
@@ -1,31 +1,13 @@
|
|
|
1
1
|
# `@combos-fun/plugin-renderer-sprite` — Agent notes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
One atlas frame. A standalone image uses `Img`. Playback uses `SpriteAnimation`.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
import { Sprite, SpriteSystem
|
|
6
|
+
import { Sprite, SpriteSystem } from '@combos-fun/plugin-renderer-sprite';
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
`Sprite.componentName = 'Sprite'
|
|
10
|
-
|
|
11
|
-
```ts
|
|
12
|
-
interface SpriteParams {
|
|
13
|
-
resource: string; // RESOURCE_TYPE.SPRITE name
|
|
14
|
-
spriteName: string; // exact atlas frames key
|
|
15
|
-
}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Importing the package registers the SPRITE instance and destroy handlers. The resource must supply atlas image and JSON data. Frame keys are prefixed as:
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
resource + RESOURCE_KEY_SPLIT + spriteName
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Pixi `Spritesheet.parse()` also registers these keys in the Texture cache, so
|
|
25
|
-
`Texture.from(cacheKey)` consumers such as NinePatch can resolve them.
|
|
9
|
+
`Sprite.componentName = 'Sprite'`. `SpriteSystem.systemName = 'Sprite'`. `resource` is a SPRITE name and must include the atlas image and JSON. `spriteName` is the atlas frame key. Cache key is `resource + RESOURCE_KEY_SPLIT + spriteName`, also registered for `Texture.from` (NinePatch). Size follows `Transform2D.size`. Observes `spriteName`, not `resource`.
|
|
26
10
|
|
|
27
11
|
```ts
|
|
28
12
|
icon.addComponent(new Sprite({ resource: 'icons', spriteName: 'coin' }));
|
|
29
13
|
```
|
|
30
|
-
|
|
31
|
-
Display dimensions follow `Transform2D.size`, not the source frame. The system observes `spriteName`, not `resource`; treat `resource` as construction-time configuration rather than expecting assignment to it alone to redraw.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/plugin-renderer-sprite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Sprite atlas rendering",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-sprite.esm.js",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"author": "sun668 <q947692259@gmail.com>",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"pixi.js": "^8.18.1",
|
|
39
|
-
"@combos-fun/
|
|
40
|
-
"@combos-fun/
|
|
41
|
-
"@combos-fun/
|
|
42
|
-
"@combos-fun/
|
|
39
|
+
"@combos-fun/engine": "0.1.16",
|
|
40
|
+
"@combos-fun/renderer-adapter": "0.1.16",
|
|
41
|
+
"@combos-fun/plugin-renderer": "0.1.16",
|
|
42
|
+
"@combos-fun/inspector-decorator": "0.1.16"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "node ../../scripts/build-package.mjs"
|