@combos-fun/plugin-renderer-tiling-sprite 0.0.44 → 0.0.46
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 +11 -36
- package/package.json +5 -5
package/agent-skill.md
CHANGED
|
@@ -1,45 +1,24 @@
|
|
|
1
1
|
# `@combos-fun/plugin-renderer-tiling-sprite` — Agent notes
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## When to read
|
|
6
|
-
|
|
7
|
-
Read for any tiling background, parallax layer, or scrolling pattern.
|
|
8
|
-
|
|
9
|
-
## Public API
|
|
3
|
+
Read only for a repeated IMAGE texture: tiled backgrounds, scrolling floors, and parallax patterns.
|
|
10
4
|
|
|
11
5
|
```ts
|
|
12
6
|
import { TilingSprite, TilingSpriteSystem, type TilingSpriteParams } from '@combos-fun/plugin-renderer-tiling-sprite';
|
|
13
7
|
```
|
|
14
8
|
|
|
15
|
-
`componentName = 'TilingSprite'
|
|
16
|
-
|
|
17
|
-
### `TilingSpriteParams`
|
|
18
|
-
|
|
19
|
-
| Field | Type | Default | Notes |
|
|
20
|
-
|-------|------|---------|-------|
|
|
21
|
-
| `resource` | `string` | — | Engine resource name (`RESOURCE_TYPE.IMAGE`) |
|
|
22
|
-
| `tileScale` | `{ x, y }` | `{ x: 1, y: 1 }` | Per-tile scale |
|
|
23
|
-
| `tilePosition` | `{ x, y }` | `{ x: 0, y: 0 }` | Tile UV offset; animate this for scrolling effects |
|
|
24
|
-
|
|
25
|
-
Total tile area uses `Transform.size`.
|
|
26
|
-
|
|
27
|
-
## Required setup
|
|
9
|
+
`TilingSprite.componentName = 'TilingSprite'`; `TilingSpriteSystem.systemName = 'TilingSprite'`.
|
|
28
10
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| Visible seams | Use a seamless texture (POT / power-of-two), set `tileScale` to integer values |
|
|
37
|
-
| Scroll feels jumpy | Increment `tilePosition` by a per-frame `delta`, not a fixed amount per tick |
|
|
11
|
+
```ts
|
|
12
|
+
interface TilingSpriteParams {
|
|
13
|
+
resource: string; // RESOURCE_TYPE.IMAGE name
|
|
14
|
+
tileScale: { x: number; y: number };
|
|
15
|
+
tilePosition: { x: number; y: number };
|
|
16
|
+
}
|
|
17
|
+
```
|
|
38
18
|
|
|
39
|
-
|
|
19
|
+
All three params are required. The class fields start with `tileScale: { x: 1, y: 1 }` and `tilePosition: { x: 0, y: 0 }` only when no params object overwrites them; normal resource construction must pass both vectors in full.
|
|
40
20
|
|
|
41
21
|
```ts
|
|
42
|
-
const bg = new GameObject('bg', { position: { x: 0, y: 0 }, size: { width: 750, height: 1334 } });
|
|
43
22
|
bg.addComponent(new TilingSprite({
|
|
44
23
|
resource: 'bg-tile',
|
|
45
24
|
tileScale: { x: 1, y: 1 },
|
|
@@ -47,8 +26,4 @@ bg.addComponent(new TilingSprite({
|
|
|
47
26
|
}));
|
|
48
27
|
```
|
|
49
28
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## Verification
|
|
53
|
-
|
|
54
|
-
`pnpm --filter @combos-fun/plugin-renderer-tiling-sprite run build`.
|
|
29
|
+
The repeated area follows `Transform.size`. The system reads IMAGE `data.image` directly, so importing `plugin-renderer-img` is unnecessary. Mutating either vector is observed deeply; advance `tilePosition` using frame delta for smooth scrolling.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/plugin-renderer-tiling-sprite",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.46",
|
|
4
4
|
"description": "Repeating tiled texture",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-tiling-sprite.esm.js",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"author": "sun668 <q947692259@gmail.com>",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"pixi.js": "^8.18.1",
|
|
40
|
-
"@combos-fun/plugin-renderer": "0.0.
|
|
41
|
-
"@combos-fun/
|
|
42
|
-
"@combos-fun/
|
|
43
|
-
"@combos-fun/
|
|
40
|
+
"@combos-fun/plugin-renderer": "0.0.46",
|
|
41
|
+
"@combos-fun/engine": "0.0.46",
|
|
42
|
+
"@combos-fun/renderer-adapter": "0.0.46",
|
|
43
|
+
"@combos-fun/inspector-decorator": "0.0.46"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "node ../../scripts/build-package.mjs"
|