@combos-fun/plugin-renderer-tiling-sprite 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 +25 -1
- package/agent-skill.md +55 -0
- package/combos-plugin.json +11 -0
- package/package.json +20 -6
package/README.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
1
|
# @combos-fun/plugin-renderer-tiling-sprite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
@combos-fun/plugin-renderer-tiling-sprite — part of the Combos Fun engine monorepo.
|
|
4
|
+
|
|
5
|
+
Keywords: `tiling`, `background`, `parallax`, `scroll`, `tile`, `2d`.
|
|
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-tiling-sprite/plugin-manifest';
|
|
21
|
+
// or fetch the markdown directly:
|
|
22
|
+
// require.resolve('@combos-fun/plugin-renderer-tiling-sprite/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,55 @@
|
|
|
1
|
+
# `@combos-fun/plugin-renderer-tiling-sprite` — Agent notes
|
|
2
|
+
|
|
3
|
+
Repeating tiled texture for the 2D pipeline. Wraps Pixi `TilingSprite`, useful for backgrounds, parallax layers, scrolling floors.
|
|
4
|
+
|
|
5
|
+
## When to read
|
|
6
|
+
|
|
7
|
+
Read for any tiling background, parallax layer, or scrolling pattern.
|
|
8
|
+
|
|
9
|
+
## Public API
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { TilingSprite, TilingSpriteSystem, type TilingSpriteParams } from '@combos-fun/plugin-renderer-tiling-sprite';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`componentName = 'TilingSprite'`, `systemName = 'TilingSpriteSystem'`.
|
|
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
|
|
28
|
+
|
|
29
|
+
`RendererSystem` then `TilingSpriteSystem`. Resource must be registered and loaded before the component is added.
|
|
30
|
+
|
|
31
|
+
## Common pitfalls
|
|
32
|
+
|
|
33
|
+
| Symptom | Fix |
|
|
34
|
+
|---------|-----|
|
|
35
|
+
| Tiles cover entire canvas | Set `Transform.size` to the desired tile area |
|
|
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 |
|
|
38
|
+
|
|
39
|
+
## Minimal example
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const bg = new GameObject('bg');
|
|
43
|
+
bg.addComponent(new Transform({ position: { x: 0, y: 0 }, size: { x: 750, y: 1334 } }));
|
|
44
|
+
bg.addComponent(new TilingSprite({
|
|
45
|
+
resource: 'bg-tile',
|
|
46
|
+
tileScale: { x: 1, y: 1 },
|
|
47
|
+
tilePosition: { x: 0, y: 0 },
|
|
48
|
+
}));
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
To animate scrolling, drive `tilePosition` from a custom Component's `update(delta)`, not from bootstrap.
|
|
52
|
+
|
|
53
|
+
## Verification
|
|
54
|
+
|
|
55
|
+
`pnpm --filter @combos-fun/plugin-renderer-tiling-sprite run build`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@combos-fun/plugin-renderer-tiling-sprite",
|
|
3
|
+
"pluginId": "renderer-tiling-sprite",
|
|
4
|
+
"category": "rendering",
|
|
5
|
+
"dimension": "2d",
|
|
6
|
+
"isCore": false,
|
|
7
|
+
"keywords": ["tiling", "background", "parallax", "scroll", "tile", "2d"],
|
|
8
|
+
"agentSkill": "./agent-skill.md",
|
|
9
|
+
"requires": ["@combos-fun/engine", "@combos-fun/plugin-renderer"],
|
|
10
|
+
"exports": ["TilingSprite", "TilingSpriteSystem"]
|
|
11
|
+
}
|
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.8",
|
|
4
4
|
"description": "@combos-fun/plugin-renderer-tiling-sprite",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-tiling-sprite.esm.js",
|
|
@@ -8,8 +8,22 @@
|
|
|
8
8
|
"unpkg": "dist/CombosFun.plugin.renderer.tilingSprite.min.js",
|
|
9
9
|
"files": [
|
|
10
10
|
"index.js",
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"agent-skill.md",
|
|
13
|
+
"combos-plugin.json"
|
|
12
14
|
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/plugin-renderer-tiling-sprite.esm.js",
|
|
18
|
+
"require": "./index.js",
|
|
19
|
+
"types": "./dist/plugin-renderer-tiling-sprite.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./plugin-manifest": "./combos-plugin.json",
|
|
22
|
+
"./agent-skill": "./agent-skill.md"
|
|
23
|
+
},
|
|
24
|
+
"combos": {
|
|
25
|
+
"pluginManifest": "./combos-plugin.json"
|
|
26
|
+
},
|
|
13
27
|
"types": "dist/plugin-renderer-tiling-sprite.d.ts",
|
|
14
28
|
"keywords": [
|
|
15
29
|
"combos-fun",
|
|
@@ -18,10 +32,10 @@
|
|
|
18
32
|
"author": "sun668 <q947692259@gmail.com>",
|
|
19
33
|
"dependencies": {
|
|
20
34
|
"pixi.js": "^8.18.1",
|
|
21
|
-
"@combos-fun/plugin-renderer": "0.0.
|
|
22
|
-
"@combos-fun/
|
|
23
|
-
"@combos-fun/
|
|
24
|
-
"@combos-fun/
|
|
35
|
+
"@combos-fun/plugin-renderer": "0.0.8",
|
|
36
|
+
"@combos-fun/engine": "0.0.8",
|
|
37
|
+
"@combos-fun/renderer-adapter": "0.0.8",
|
|
38
|
+
"@combos-fun/inspector-decorator": "0.0.8"
|
|
25
39
|
},
|
|
26
40
|
"scripts": {
|
|
27
41
|
"build": "node ../../scripts/build-package.mjs"
|