lyb-pixi-js 1.7.7 → 1.8.1

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.
@@ -0,0 +1,7 @@
1
+ import { Graphics } from "pixi.js";
2
+ /** @description 圆形
3
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiCircular-圆形
4
+ */
5
+ export declare class LibPixiCircular extends Graphics {
6
+ constructor(radius: number, color: string);
7
+ }
@@ -0,0 +1,12 @@
1
+ import { Graphics } from "pixi.js";
2
+ /** @description 圆形
3
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiCircular-圆形
4
+ */
5
+ export class LibPixiCircular extends Graphics {
6
+ constructor(radius, color) {
7
+ super();
8
+ this.beginFill(color);
9
+ this.drawCircle(0, 0, radius);
10
+ this.endFill();
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ import { Graphics, type IPointData } from "pixi.js";
2
+ /** @description 多边形类,可用于一些场景的局部点击,传颜色是为了方便定位,最终可能需要将颜色隐藏掉
3
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiPolygon-多边形
4
+ */
5
+ export declare class LibPixiPolygon extends Graphics {
6
+ constructor(points: IPointData[] | number[], color?: string);
7
+ }
@@ -0,0 +1,15 @@
1
+ import { Graphics } from "pixi.js";
2
+ /** @description 多边形类,可用于一些场景的局部点击,传颜色是为了方便定位,最终可能需要将颜色隐藏掉
3
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiPolygon-多边形
4
+ */
5
+ export class LibPixiPolygon extends Graphics {
6
+ constructor(points, color) {
7
+ super();
8
+ this.beginFill(color || 0x000000);
9
+ this.drawPolygon(points);
10
+ this.endFill();
11
+ if (!color) {
12
+ this.alpha = 0;
13
+ }
14
+ }
15
+ }
@@ -40,7 +40,6 @@ export class LibPixiRectBgColor extends Graphics {
40
40
  }
41
41
  else {
42
42
  this.beginFill(this.bgColor, this.bgAlpha);
43
- this.borderWidth && this.lineStyle(this.borderWidth, this.borderColor, 1);
44
43
  }
45
44
  this.borderWidth && this.lineStyle(this.borderWidth, this.borderColor, 1);
46
45
  if (this.radius !== 0) {
@@ -0,0 +1,7 @@
1
+ import { Graphics } from "pixi.js";
2
+ /** @description 矩形类,可用于一些场景的局部点击,传颜色是为了方便定位,最终可能需要将颜色隐藏掉
3
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiRectangle-矩形
4
+ */
5
+ export declare class LibPixiRectangle extends Graphics {
6
+ constructor(width: number, height: number, color?: string);
7
+ }
@@ -0,0 +1,15 @@
1
+ import { Graphics } from "pixi.js";
2
+ /** @description 矩形类,可用于一些场景的局部点击,传颜色是为了方便定位,最终可能需要将颜色隐藏掉
3
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiRectangle-矩形
4
+ */
5
+ export class LibPixiRectangle extends Graphics {
6
+ constructor(width, height, color) {
7
+ super();
8
+ this.beginFill(color || 0x000000);
9
+ this.drawRect(0, 0, width, height);
10
+ this.endFill();
11
+ if (!color) {
12
+ this.alpha = 0;
13
+ }
14
+ }
15
+ }
package/README.md CHANGED
@@ -92,6 +92,12 @@ app.stage.addChild(box);
92
92
 
93
93
  \- [LibPixiRectBgColor-矩形](#LibPixiRectBgColor-矩形)
94
94
 
95
+ \- [LibPixiRectangle-矩形](#LibPixiRectangle-矩形)
96
+
97
+ \- [LibPixiCircular-圆形](#LibPixiCircular-圆形)
98
+
99
+ \- [LibPixiPolygon-多边形](#LibPixiPolygon-多边形)
100
+
95
101
  \- [LibPixiSpine-动画](#LibPixiSpine-动画)
96
102
 
97
103
  \- [LibPixiParticleMove-粒子容器](#LibPixiParticleMove-粒子容器)
@@ -296,6 +302,35 @@ interface LibPixiRectBgColorParams {
296
302
  }
297
303
  ```
298
304
 
305
+ ### LibPixiRectangle-矩形
306
+
307
+ > `LibPixiRectBgColor`精简版,可用于一些场景的局部点击,传颜色是为了方便定位,最终可能需要将颜色隐藏掉
308
+
309
+ ```ts
310
+ const libPixiRectangle = new LibPixiRectangle(100, 100, "#fff");
311
+ ```
312
+
313
+ ### LibPixiPolygon-多边形
314
+
315
+ > 多边形类,可用于一些场景的局部点击,传颜色是为了方便定位,最终可能需要将颜色隐藏掉
316
+
317
+ ```ts
318
+ const polygonVertices = new LibPixiPolygon([
319
+ 0, 0, 604, 0, 596, 32, 616, 30, 611, 62, 644, 57, 643, 87, 697, 82, 702, 102, 724, 86, 744, 83, 753, 91, 756, 83,
320
+ 772, 85, 793, 100, 797, 114, 794, 316, 798, 336, 799, 476, 796, 491, 801, 507, 797, 635, 742, 656, 723, 683, 659,
321
+ 687, 638, 678, 646, 712, 617, 707, 611, 717, 618, 741, 596, 734, 595, 746, 601, 762, 14, 763, 18, 739, -4, 741, 4,
322
+ 712, -5, 705, -28, 711, -22, 686, -34, 679, -47, 686, -195, 686, -189, 667, -192, 647, -195, 506, -192, 499, -194,
323
+ 476, -192, 331, -187, 323, -193, 307, -194, 110, -188, 103, -189, 93, -172, 81, -112, 82, -98, 95, -93, 80, -56,
324
+ 82, -40, 89, -36, 80, -41, 57, -30, 57, -16, 62, -8, 58, -16, 29, 1, 35, 8, 25, 0, 0,
325
+ ], "#000");
326
+ ```
327
+
328
+ ### LibPixiCircular-圆形
329
+
330
+ ```ts
331
+ const libPixiCircular = new LibPixiCircular(100, "#fff");
332
+ ```
333
+
299
334
  ### LibPixiSpine-动画
300
335
 
301
336
  > 自定义 Spine 动画,内置挂点
package/libPixiJs.d.ts CHANGED
@@ -19,7 +19,10 @@ import { LibPixiAudio } from "./Utils/LibPixiAudio";
19
19
  import { LibPixiSlideInput } from "./Utils/LibPixiSlideInput";
20
20
  import { LibPixiGlobalUpdater } from "./Utils/LibPixiGlobalUpdater";
21
21
  import { LibPixiPolygonDrawTool } from "./Utils/LibPixiPolygonDrawTool";
22
- import { LibPixiHtmlText } from './Components/Base/LibPixiHtmlText';
22
+ import { LibPixiHtmlText } from "./Components/Base/LibPixiHtmlText";
23
+ import { LibPixiRectangle } from "./Components/Base/LibPixiRectangle";
24
+ import { LibPixiPolygon } from "./Components/Base/LibPixiPolygon";
25
+ import { LibPixiCircular } from "./Components/Base/LibPixiCircular";
23
26
  /** @description 组件 */
24
27
  export declare const Components: {
25
28
  Base: {
@@ -39,6 +42,18 @@ export declare const Components: {
39
42
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiRectBgColor-矩形
40
43
  */
41
44
  LibPixiRectBgColor: typeof LibPixiRectBgColor;
45
+ /** @description 矩形类,可用于一些场景的局部点击,传颜色是为了方便定位,最终可能需要将颜色隐藏掉
46
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiRectangle-矩形
47
+ */
48
+ LibPixiRectangle: typeof LibPixiRectangle;
49
+ /** @description 圆形
50
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiCircular-圆形
51
+ */
52
+ LibPixiCircular: typeof LibPixiCircular;
53
+ /** @description 多边形类
54
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiPolygon-多边形
55
+ */
56
+ LibPixiPolygon: typeof LibPixiPolygon;
42
57
  /** @description 自定义 Spine 动画
43
58
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiSpine-动画
44
59
  */
package/libPixiJs.js CHANGED
@@ -29,7 +29,10 @@ import { libPixiTickerTimeout } from "./Utils/LibPixiTickerTimeout";
29
29
  import { LibPixiSlideInput } from "./Utils/LibPixiSlideInput";
30
30
  import { LibPixiGlobalUpdater } from "./Utils/LibPixiGlobalUpdater";
31
31
  import { LibPixiPolygonDrawTool } from "./Utils/LibPixiPolygonDrawTool";
32
- import { LibPixiHtmlText } from './Components/Base/LibPixiHtmlText';
32
+ import { LibPixiHtmlText } from "./Components/Base/LibPixiHtmlText";
33
+ import { LibPixiRectangle } from "./Components/Base/LibPixiRectangle";
34
+ import { LibPixiPolygon } from "./Components/Base/LibPixiPolygon";
35
+ import { LibPixiCircular } from "./Components/Base/LibPixiCircular";
33
36
  /** @description 组件 */
34
37
  export const Components = {
35
38
  Base: {
@@ -49,6 +52,18 @@ export const Components = {
49
52
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiRectBgColor-矩形
50
53
  */
51
54
  LibPixiRectBgColor,
55
+ /** @description 矩形类,可用于一些场景的局部点击,传颜色是为了方便定位,最终可能需要将颜色隐藏掉
56
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiRectangle-矩形
57
+ */
58
+ LibPixiRectangle,
59
+ /** @description 圆形
60
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiCircular-圆形
61
+ */
62
+ LibPixiCircular,
63
+ /** @description 多边形类
64
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiPolygon-多边形
65
+ */
66
+ LibPixiPolygon,
52
67
  /** @description 自定义 Spine 动画
53
68
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiSpine-动画
54
69
  */
package/lyb-pixi.js CHANGED
@@ -29781,7 +29781,6 @@ void main(void)\r
29781
29781
  this.tint = this.bgColor;
29782
29782
  } else {
29783
29783
  this.beginFill(this.bgColor, this.bgAlpha);
29784
- this.borderWidth && this.lineStyle(this.borderWidth, this.borderColor, 1);
29785
29784
  }
29786
29785
  this.borderWidth && this.lineStyle(this.borderWidth, this.borderColor, 1);
29787
29786
  if (this.radius !== 0) {
@@ -54877,6 +54876,36 @@ void main(void){
54877
54876
  }
54878
54877
  }
54879
54878
  }
54879
+ class LibPixiRectangle extends Graphics {
54880
+ constructor(width, height, color) {
54881
+ super();
54882
+ this.beginFill(color || 0);
54883
+ this.drawRect(0, 0, width, height);
54884
+ this.endFill();
54885
+ if (!color) {
54886
+ this.alpha = 0;
54887
+ }
54888
+ }
54889
+ }
54890
+ class LibPixiPolygon extends Graphics {
54891
+ constructor(points, color) {
54892
+ super();
54893
+ this.beginFill(color || 0);
54894
+ this.drawPolygon(points);
54895
+ this.endFill();
54896
+ if (!color) {
54897
+ this.alpha = 0;
54898
+ }
54899
+ }
54900
+ }
54901
+ class LibPixiCircular extends Graphics {
54902
+ constructor(radius, color) {
54903
+ super();
54904
+ this.beginFill(color);
54905
+ this.drawCircle(0, 0, radius);
54906
+ this.endFill();
54907
+ }
54908
+ }
54880
54909
  const Components = {
54881
54910
  Base: {
54882
54911
  /** @description 自定义位图文本
@@ -54895,6 +54924,18 @@ void main(void){
54895
54924
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiRectBgColor-矩形
54896
54925
  */
54897
54926
  LibPixiRectBgColor,
54927
+ /** @description 矩形类,可用于一些场景的局部点击,传颜色是为了方便定位,最终可能需要将颜色隐藏掉
54928
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiRectangle-矩形
54929
+ */
54930
+ LibPixiRectangle,
54931
+ /** @description 圆形
54932
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiCircular-圆形
54933
+ */
54934
+ LibPixiCircular,
54935
+ /** @description 多边形类
54936
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiPolygon-多边形
54937
+ */
54938
+ LibPixiPolygon,
54898
54939
  /** @description 自定义 Spine 动画
54899
54940
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiSpine-动画
54900
54941
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.7.7",
3
+ "version": "1.8.1",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "exports": {