@combos-fun/plugin-renderer-mask 0.1.15 → 0.1.17

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.
Files changed (2) hide show
  1. package/agent-skill.md +6 -20
  2. package/package.json +5 -5
package/agent-skill.md CHANGED
@@ -1,31 +1,17 @@
1
1
  # `@combos-fun/plugin-renderer-mask` — Agent notes
2
2
 
3
- Read only to clip a GameObject container with local vector geometry or texture alpha.
3
+ Clips a GameObject with local geometry or texture alpha.
4
4
 
5
5
  ```ts
6
- import { Mask, MaskSystem, MASK_TYPE, type MaskParams } from '@combos-fun/plugin-renderer-mask';
6
+ import { Mask, MaskSystem, MASK_TYPE } from '@combos-fun/plugin-renderer-mask';
7
7
  ```
8
8
 
9
- `Mask.componentName = 'Mask'`; `MaskSystem.systemName = 'Mask'`.
9
+ `Mask.componentName = 'Mask'`. `MaskSystem.systemName = 'Mask'`.
10
10
 
11
- `MASK_TYPE` is `Circle | Ellipse | Rect | RoundedRect | Polygon | Img | Sprite`.
11
+ `MASK_TYPE`: `Circle | Ellipse | Rect | RoundedRect | Polygon | Img | Sprite`. Pass a concrete `style`. Circle: `x/y/radius`. Ellipse and Rect: `x/y/width/height`. RoundedRect adds `radius`. Polygon: flat `paths`. Missing sizes default to `0`. `style: undefined` throws.
12
12
 
13
- ```ts
14
- interface MaskParams {
15
- type: MASK_TYPE;
16
- style?: { x?: number; y?: number; radius?: number; width?: number; height?: number; paths?: number[] };
17
- resource?: string;
18
- spriteName?: string;
19
- }
20
- ```
21
-
22
- Pass a concrete `style`: Circle uses `x/y/radius`; Ellipse and Rect use `x/y/width/height`; RoundedRect also uses `radius`; Polygon uses flat local-space `paths`. Missing dimensions default to zero and can hide everything. Explicit `style: undefined` throws `no have Mask style`.
13
+ `Img` reads IMAGE `data.image` directly. `Sprite` needs a SPRITE `resource`, `spriteName`, and imported `plugin-renderer-sprite`. Texture masks use source alpha; `style` is their local position and size. A zero size hides the object.
23
14
 
24
15
  ```ts
25
- go.addComponent(new Mask({
26
- type: MASK_TYPE.Circle,
27
- style: { x: 0, y: 0, radius: 50 },
28
- }));
16
+ go.addComponent(new Mask({ type: MASK_TYPE.Circle, style: { x: 0, y: 0, radius: 50 } }));
29
17
  ```
30
-
31
- `Img` masks require an IMAGE `resource` and read `data.image` directly—no `plugin-renderer-img` import is needed. `Sprite` masks require a SPRITE `resource`, exact `spriteName`, and `plugin-renderer-sprite` imported so its atlas instance factory runs. Texture masks use source alpha and `style` supplies their local position and size.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/plugin-renderer-mask",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Pixi mask Component",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-mask.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.1.15",
41
- "@combos-fun/renderer-adapter": "0.1.15",
42
- "@combos-fun/engine": "0.1.15",
43
- "@combos-fun/inspector-decorator": "0.1.15"
40
+ "@combos-fun/engine": "0.1.17",
41
+ "@combos-fun/plugin-renderer": "0.1.17",
42
+ "@combos-fun/inspector-decorator": "0.1.17",
43
+ "@combos-fun/renderer-adapter": "0.1.17"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "node ../../scripts/build-package.mjs"