lyb-pixi-js 1.0.2 → 1.0.4

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 CHANGED
@@ -15,7 +15,7 @@
15
15
  ```ts
16
16
  import { LibPixiJs } from "lyb-pixi-js";
17
17
 
18
- const text = new LibPixiJs.Base.LibText({
18
+ const text = new LibPixiJs.Base.LibPixiText({
19
19
  text: "Hello World!",
20
20
  fontSize: 50,
21
21
  fontColor:"red",
@@ -26,9 +26,9 @@ app.stage.addChild(text);
26
26
  > 按需引入,打包时就不会把整个库打进去
27
27
 
28
28
  ```ts
29
- import { LibRectBgColor } from "lyb-pixi-js/dist/Base/LibRectBgColor";
29
+ import { LibRectBgColor } from "lyb-pixi-js/dist/Base/LibPixiRectBgColor";
30
30
 
31
- const box = new LibRectBgColor({
31
+ const box = new LibPixiRectBgColor({
32
32
  width: 100,
33
33
  height: 100,
34
34
  bgColor: "red",
@@ -40,20 +40,20 @@ app.stage.addChild(box);
40
40
 
41
41
  ```ts
42
42
  //你的公共工具函数文件 utils.ts
43
- export * from "lyb-pixi-js/dist/Base/LibText";
44
- export * from "lyb-pixi-js/dist/Base/LibRectBgColor";
43
+ export * from "lyb-pixi-js/dist/Base/LibPixiText";
44
+ export * from "lyb-pixi-js/dist/Base/LibPixiRectBgColor";
45
45
 
46
46
  //你的项目文件 index.ts
47
47
  import { LibText,LibRectBgColor } from "utils";
48
48
 
49
- const text = new LibText({
49
+ const text = new LibPixiText({
50
50
  text: "Hello World!",
51
51
  fontSize: 50,
52
52
  fontColor:"red",
53
53
  });
54
54
  app.stage.addChild(text);
55
55
 
56
- const box = new LibRectBgColor({
56
+ const box = new LibPixiRectBgColor({
57
57
  width: 100,
58
58
  height: 100,
59
59
  bgColor: "red",
@@ -69,7 +69,7 @@ app.stage.addChild(box);
69
69
  <script src="https://unpkg.com/lyb-pixi-js/umd/lyb-pixi.js"></script>
70
70
 
71
71
  <script>
72
- const text = new LibPixiJs.Base.LibText({
72
+ const text = new LibPixiJs.Base.LibPixiText({
73
73
  text: "Hello World!",
74
74
  fontSize: 50,
75
75
  fontColor:"red",
@@ -82,27 +82,27 @@ app.stage.addChild(text);
82
82
 
83
83
  ### 基础
84
84
 
85
- \- [LibText-文本](#LibText-文本)
85
+ \- [LibPixiText-文本](#LibPixiText-文本)
86
86
 
87
- \- [LibBitText-位图](#LibBitText-位图)
87
+ \- [LibPixiBitText-位图](#LibPixiBitText-位图)
88
88
 
89
- \- [LibContainer-容器](#LibContainer-容器)
89
+ \- [LibPixiContainer-容器](#LibPixiContainer-容器)
90
90
 
91
- \- [LibRectBgColor-矩形](#LibRectBgColor-矩形)
91
+ \- [LibPixiRectBgColor-矩形](#LibPixiRectBgColor-矩形)
92
92
 
93
- \- [LibSpine-动画](#LibSpine-动画)
93
+ \- [LibPixiSpine-动画](#LibPixiSpine-动画)
94
94
 
95
- \- [LibParticleMove-粒子容器](#LibParticleMove-粒子容器)
95
+ \- [LibPixiParticleMove-粒子容器](#LibPixiParticleMove-粒子容器)
96
96
 
97
97
 
98
98
  ## Base-基础
99
99
 
100
- ### LibText-文本
100
+ ### LibPixiText-文本
101
101
 
102
102
  > 自定义文本类
103
103
 
104
104
  ```ts
105
- const text = new LibPixiJs.Base.LibText({
105
+ const text = new LibPixiJs.Base.LibPixiText({
106
106
  text: "Hello World!",
107
107
  fontSize: 50,
108
108
  fontColor:"red",
@@ -110,30 +110,30 @@ const text = new LibPixiJs.Base.LibText({
110
110
  this.addChild(text);
111
111
  ```
112
112
 
113
- ### LibBitText-位图
113
+ ### LibPixiBitText-位图
114
114
 
115
115
  > 自定义位图文本
116
116
 
117
117
  ```ts
118
118
  //所有文字使用同一个字体大小
119
- const font = new LibBitText("FontName", 16);
119
+ const font = new LibPixiBitText("FontName", 16);
120
120
  const fontText = font.createText("10");
121
121
  this.addChild(fontText);
122
122
 
123
123
  //同字体不同大小
124
- const font = new LibBitText("FontName");
124
+ const font = new LibPixiBitText("FontName");
125
125
  const fontText1 = font.createText("10", 16);
126
126
  this.addChild(fontText1);
127
127
  const fontText2 = font.createText("10", 24);
128
128
  this.addChild(fontText2);
129
129
  ```
130
130
 
131
- ### LibContainer-容器
131
+ ### LibPixiContainer-容器
132
132
 
133
133
  > 自定义容器大小及背景色
134
134
 
135
135
  ```ts
136
- const box = new LibPixiJs.Base.LibContainer({
136
+ const box = new LibPixiJs.Base.LibPixiContainer({
137
137
  width: 100,
138
138
  height: 100,
139
139
  bgColor: "#fff",
@@ -142,12 +142,12 @@ const box = new LibPixiJs.Base.LibContainer({
142
142
  this.addChild(box);
143
143
  ```
144
144
 
145
- ### LibRectBgColor-矩形
145
+ ### LibPixiRectBgColor-矩形
146
146
 
147
147
  > 自定义矩形背景色
148
148
 
149
149
  ```ts
150
- const rect = new LibRectBgColor({
150
+ const rect = new LibPixiRectBgColor({
151
151
  width: 100,
152
152
  height: 100,
153
153
  bgColor: "red",
@@ -155,19 +155,19 @@ const rect = new LibRectBgColor({
155
155
  this.addChild(rect);
156
156
  ```
157
157
 
158
- ### LibSpine-动画
158
+ ### LibPixiSpine-动画
159
159
 
160
160
  > 自定义 Spine 动画,内置挂点
161
161
 
162
162
  ```ts
163
163
  //基础使用
164
- const spine = new LibSpine(Assets.get("lihe"));
164
+ const spine = new LibPixiSpine(Assets.get("lihe"));
165
165
  spine.setAnimation("in");
166
166
  spine.addAnimation("idle", true);
167
167
  this.addChild(spine);
168
168
 
169
169
  //挂点
170
- this.bgSpine = new LibSpine("spine_buyfree", {
170
+ this.bgSpine = new LibPixiSpine("spine_buyfree", {
171
171
  followPointList: [
172
172
  {
173
173
  boneName: "aaa",
@@ -189,12 +189,12 @@ this.bgSpine = new LibSpine("spine_buyfree", {
189
189
  });
190
190
  ```
191
191
 
192
- ### LibParticleMove-粒子容器
192
+ ### LibPixiParticleMove-粒子容器
193
193
 
194
194
  > 利用贝塞尔曲线实现粒子移动
195
195
 
196
196
  ```ts
197
- const libParticleMove = new LibPixiJs.Base.LibParticleMove({
197
+ const libPixiParticleMove = new LibPixiJs.Base.LibPixiParticleMove({
198
198
  start: { x: 300, y: 600 },
199
199
  control: [
200
200
  { x: 600, y: 500 },
@@ -1,6 +1,6 @@
1
1
  import { BitmapText } from "pixi.js";
2
2
  /** @description 自定义位图文本 */
3
- export declare class LibBitText {
3
+ export declare class LibPixiBitText {
4
4
  /** 字体名称 */
5
5
  private _fontName;
6
6
  private _defaultFontSize?;
@@ -1,11 +1,11 @@
1
1
  import { BitmapText } from "pixi.js";
2
2
  /** @description 自定义位图文本 */
3
- var LibBitText = /** @class */ (function () {
3
+ var LibPixiBitText = /** @class */ (function () {
4
4
  /**
5
5
  * @param fontName 字体名称
6
6
  * @param defaultFontSize 默认字体大小
7
7
  */
8
- function LibBitText(fontName, defaultFontSize) {
8
+ function LibPixiBitText(fontName, defaultFontSize) {
9
9
  this._fontName = fontName;
10
10
  this._defaultFontSize = defaultFontSize;
11
11
  }
@@ -14,13 +14,13 @@ var LibBitText = /** @class */ (function () {
14
14
  * @param fontSize 字体大小,不填则使用默认大小
15
15
  * @returns 位图实例
16
16
  */
17
- LibBitText.prototype.createText = function (text, fontSize) {
17
+ LibPixiBitText.prototype.createText = function (text, fontSize) {
18
18
  var bitMapText = new BitmapText(text.toString(), {
19
19
  fontName: this._fontName,
20
20
  fontSize: this._defaultFontSize || fontSize,
21
21
  });
22
22
  return bitMapText;
23
23
  };
24
- return LibBitText;
24
+ return LibPixiBitText;
25
25
  }());
26
- export { LibBitText };
26
+ export { LibPixiBitText };
@@ -1,5 +1,5 @@
1
1
  import { Container } from "pixi.js";
2
- interface LibContainerParams {
2
+ interface LibPixiContainerParams {
3
3
  /** 宽度 */
4
4
  width: number;
5
5
  /** 高度 */
@@ -10,7 +10,7 @@ interface LibContainerParams {
10
10
  bgColor?: string;
11
11
  }
12
12
  /** @description 自定义容器大小及背景色 */
13
- export declare class LibContainer extends Container {
13
+ export declare class LibPixiContainer extends Container {
14
14
  /** 填充容器 */
15
15
  private _fill?;
16
16
  /** 背景色填充 */
@@ -20,7 +20,7 @@ export declare class LibContainer extends Container {
20
20
  * @param height 容器高度
21
21
  * @param bgColor 背景色
22
22
  */
23
- constructor(params: LibContainerParams);
23
+ constructor(params: LibPixiContainerParams);
24
24
  /** @description 设置容器大小 */
25
25
  setSize(width: number, height: number): void;
26
26
  }
@@ -14,16 +14,16 @@ var __extends = (this && this.__extends) || (function () {
14
14
  };
15
15
  })();
16
16
  import { Container, Graphics, Sprite } from "pixi.js";
17
- import { LibRectBgColor } from "../LibRectBgColor";
17
+ import { LibPixiRectBgColor } from "../LibPixiRectBgColor";
18
18
  /** @description 自定义容器大小及背景色 */
19
- var LibContainer = /** @class */ (function (_super) {
20
- __extends(LibContainer, _super);
19
+ var LibPixiContainer = /** @class */ (function (_super) {
20
+ __extends(LibPixiContainer, _super);
21
21
  /**
22
22
  * @param width 容器宽度
23
23
  * @param height 容器高度
24
24
  * @param bgColor 背景色
25
25
  */
26
- function LibContainer(params) {
26
+ function LibPixiContainer(params) {
27
27
  var _this = _super.call(this) || this;
28
28
  var width = params.width, height = params.height, overHidden = params.overHidden, bgColor = params.bgColor;
29
29
  if (overHidden) {
@@ -35,7 +35,7 @@ var LibContainer = /** @class */ (function (_super) {
35
35
  _this.mask = mask;
36
36
  }
37
37
  if (bgColor) {
38
- _this._bgColorFill = new LibRectBgColor({
38
+ _this._bgColorFill = new LibPixiRectBgColor({
39
39
  width: width,
40
40
  height: height,
41
41
  bgColor: bgColor,
@@ -51,7 +51,7 @@ var LibContainer = /** @class */ (function (_super) {
51
51
  return _this;
52
52
  }
53
53
  /** @description 设置容器大小 */
54
- LibContainer.prototype.setSize = function (width, height) {
54
+ LibPixiContainer.prototype.setSize = function (width, height) {
55
55
  if (this._fill) {
56
56
  this._fill.width = width;
57
57
  this._fill.height = height;
@@ -60,6 +60,6 @@ var LibContainer = /** @class */ (function (_super) {
60
60
  this._bgColorFill.renderBg(width, height);
61
61
  }
62
62
  };
63
- return LibContainer;
63
+ return LibPixiContainer;
64
64
  }(Container));
65
- export { LibContainer };
65
+ export { LibPixiContainer };
@@ -1,6 +1,6 @@
1
1
  import { Container } from "pixi.js";
2
2
  import { type EmitterConfigV3 } from "@pixi/particle-emitter";
3
- export interface LibParticleMoveParams {
3
+ export interface LibPixiParticleMoveParams {
4
4
  /** 粒子JSON资源 */
5
5
  json: EmitterConfigV3;
6
6
  /** 运动时长 */
@@ -28,9 +28,9 @@ export interface LibParticleMoveParams {
28
28
  loop?: boolean;
29
29
  }
30
30
  /** @description 利用贝塞尔曲线实现粒子移动 */
31
- export declare class LibParticleMove extends Container {
31
+ export declare class LibPixiParticleMove extends Container {
32
32
  private _particleContainer;
33
- constructor(params: LibParticleMoveParams);
33
+ constructor(params: LibPixiParticleMoveParams);
34
34
  private _createBezierPoints;
35
35
  private _multiPointBezier;
36
36
  private _binomial;
@@ -25,11 +25,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
25
25
  import { Container, ParticleContainer, Ticker } from "pixi.js";
26
26
  import { Emitter } from "@pixi/particle-emitter";
27
27
  import gsap from "gsap";
28
- import { LibText } from "../LibText";
28
+ import { LibPixiText } from "../LibPixiText";
29
29
  /** @description 利用贝塞尔曲线实现粒子移动 */
30
- var LibParticleMove = /** @class */ (function (_super) {
31
- __extends(LibParticleMove, _super);
32
- function LibParticleMove(params) {
30
+ var LibPixiParticleMove = /** @class */ (function (_super) {
31
+ __extends(LibPixiParticleMove, _super);
32
+ function LibPixiParticleMove(params) {
33
33
  var _this = _super.call(this) || this;
34
34
  var start = params.start, control = params.control, end = params.end, json = params.json, duration = params.duration, _a = params.ease, ease = _a === void 0 ? "power1.out" : _a, _b = params.showControl, showControl = _b === void 0 ? false : _b, _c = params.loop, loop = _c === void 0 ? false : _c;
35
35
  _this._particleContainer = new ParticleContainer();
@@ -72,14 +72,14 @@ var LibParticleMove = /** @class */ (function (_super) {
72
72
  ticker.start();
73
73
  return _this;
74
74
  }
75
- LibParticleMove.prototype._createBezierPoints = function (anchorPoints, pointsAmount, showControl) {
75
+ LibPixiParticleMove.prototype._createBezierPoints = function (anchorPoints, pointsAmount, showControl) {
76
76
  var _this = this;
77
77
  var points = [];
78
78
  // 渲染控制点
79
79
  if (showControl) {
80
80
  anchorPoints.forEach(function (item, index) {
81
81
  //创建一个小圆点
82
- var text = new LibText({
82
+ var text = new LibPixiText({
83
83
  text: index + 1,
84
84
  fontSize: 16,
85
85
  });
@@ -94,7 +94,7 @@ var LibParticleMove = /** @class */ (function (_super) {
94
94
  }
95
95
  return points;
96
96
  };
97
- LibParticleMove.prototype._multiPointBezier = function (points, t) {
97
+ LibPixiParticleMove.prototype._multiPointBezier = function (points, t) {
98
98
  var len = points.length;
99
99
  var x = 0, y = 0;
100
100
  // 预计算组合数
@@ -113,7 +113,7 @@ var LibParticleMove = /** @class */ (function (_super) {
113
113
  }
114
114
  return { x: x, y: y };
115
115
  };
116
- LibParticleMove.prototype._binomial = function (n, k) {
116
+ LibPixiParticleMove.prototype._binomial = function (n, k) {
117
117
  if (k === 0 || k === n)
118
118
  return 1;
119
119
  var res = 1;
@@ -122,6 +122,6 @@ var LibParticleMove = /** @class */ (function (_super) {
122
122
  }
123
123
  return res;
124
124
  };
125
- return LibParticleMove;
125
+ return LibPixiParticleMove;
126
126
  }(Container));
127
- export { LibParticleMove };
127
+ export { LibPixiParticleMove };
@@ -1,5 +1,5 @@
1
1
  import { Graphics } from "pixi.js";
2
- export interface LibRectBgColorParams {
2
+ export interface LibPixiRectBgColorParams {
3
3
  /** 宽度 */
4
4
  width?: number;
5
5
  /** 高度 */
@@ -14,12 +14,12 @@ export interface LibRectBgColorParams {
14
14
  enableTint?: boolean;
15
15
  }
16
16
  /** @description 自定义矩形背景色 */
17
- export declare class LibRectBgColor extends Graphics {
17
+ export declare class LibPixiRectBgColor extends Graphics {
18
18
  /** 启用着色 */
19
19
  private enableTint;
20
20
  /** 背景颜色 */
21
21
  private bgColor;
22
- constructor(options: LibRectBgColorParams);
22
+ constructor(options: LibPixiRectBgColorParams);
23
23
  /** @description 重新绘制并添加颜色 */
24
24
  updateColor(tint: string): void;
25
25
  /** @description 更新宽度 */
@@ -16,9 +16,9 @@ var __extends = (this && this.__extends) || (function () {
16
16
  import { Graphics } from "pixi.js";
17
17
  import gsap from "gsap";
18
18
  /** @description 自定义矩形背景色 */
19
- var LibRectBgColor = /** @class */ (function (_super) {
20
- __extends(LibRectBgColor, _super);
21
- function LibRectBgColor(options) {
19
+ var LibPixiRectBgColor = /** @class */ (function (_super) {
20
+ __extends(LibPixiRectBgColor, _super);
21
+ function LibPixiRectBgColor(options) {
22
22
  var _this = _super.call(this) || this;
23
23
  /** 启用着色 */
24
24
  _this.enableTint = true;
@@ -33,11 +33,11 @@ var LibRectBgColor = /** @class */ (function (_super) {
33
33
  return _this;
34
34
  }
35
35
  /** @description 重新绘制并添加颜色 */
36
- LibRectBgColor.prototype.updateColor = function (tint) {
36
+ LibPixiRectBgColor.prototype.updateColor = function (tint) {
37
37
  gsap.to(this, { tint: tint, duration: 0.25 });
38
38
  };
39
39
  /** @description 更新宽度 */
40
- LibRectBgColor.prototype.renderBg = function (width, height) {
40
+ LibPixiRectBgColor.prototype.renderBg = function (width, height) {
41
41
  this.clear();
42
42
  if (this.enableTint) {
43
43
  this.beginFill("#fff");
@@ -49,11 +49,6 @@ var LibRectBgColor = /** @class */ (function (_super) {
49
49
  this.drawRect(0, 0, width, height);
50
50
  this.endFill();
51
51
  };
52
- return LibRectBgColor;
52
+ return LibPixiRectBgColor;
53
53
  }(Graphics));
54
- export { LibRectBgColor };
55
- new LibRectBgColor({
56
- width: 100,
57
- height: 100,
58
- bgColor: "red",
59
- });
54
+ export { LibPixiRectBgColor };
@@ -7,7 +7,7 @@ export interface OnUpdateParams {
7
7
  scaleX: number;
8
8
  scaleY: number;
9
9
  }
10
- export interface LibSpineParams {
10
+ export interface LibPixiSpineParams {
11
11
  /** 默认是否可见 */
12
12
  visible?: boolean;
13
13
  /** 挂点列表 */
@@ -25,14 +25,14 @@ export interface LibSpineParams {
25
25
  }[];
26
26
  }
27
27
  /** @description 自定义 Spine 动画 */
28
- export declare class LibSpine extends Spine {
28
+ export declare class LibPixiSpine extends Spine {
29
29
  /** 挂点 */
30
30
  private _followDots;
31
31
  /** 是否已开始 */
32
32
  private _isStart;
33
33
  /** spine更新函数 */
34
34
  private _loopFn;
35
- constructor(texture: any, params?: LibSpineParams);
35
+ constructor(texture: any, params?: LibPixiSpineParams);
36
36
  /** @description 设置动画
37
37
  * @param animationName 动画名称
38
38
  * @param loop 是否循环播放
@@ -17,9 +17,9 @@ import { Ticker } from "pixi.js";
17
17
  import { Spine } from "@pixi-spine/runtime-3.8";
18
18
  import gsap from "gsap";
19
19
  /** @description 自定义 Spine 动画 */
20
- var LibSpine = /** @class */ (function (_super) {
21
- __extends(LibSpine, _super);
22
- function LibSpine(texture, params) {
20
+ var LibPixiSpine = /** @class */ (function (_super) {
21
+ __extends(LibPixiSpine, _super);
22
+ function LibPixiSpine(texture, params) {
23
23
  var _this = this;
24
24
  var _a = params || {}, followPointList = _a.followPointList, _b = _a.visible, visible = _b === void 0 ? false : _b;
25
25
  _this = _super.call(this, texture.spineData) || this;
@@ -51,7 +51,7 @@ var LibSpine = /** @class */ (function (_super) {
51
51
  * @param loop 是否循环播放
52
52
  * @param delay 是否延迟播放
53
53
  */
54
- LibSpine.prototype.setAnimation = function (animationName, loop, delay) {
54
+ LibPixiSpine.prototype.setAnimation = function (animationName, loop, delay) {
55
55
  var _this = this;
56
56
  if (animationName === void 0) { animationName = "Animation"; }
57
57
  if (loop === void 0) { loop = false; }
@@ -77,7 +77,7 @@ var LibSpine = /** @class */ (function (_super) {
77
77
  * @param loop 是否循环播放
78
78
  * @param delay 延迟播放时间
79
79
  */
80
- LibSpine.prototype.addAnimation = function (animationName, loop, delay) {
80
+ LibPixiSpine.prototype.addAnimation = function (animationName, loop, delay) {
81
81
  var _this = this;
82
82
  if (animationName === void 0) { animationName = "Animation"; }
83
83
  if (loop === void 0) { loop = false; }
@@ -93,22 +93,22 @@ var LibSpine = /** @class */ (function (_super) {
93
93
  });
94
94
  };
95
95
  /** @description 改变骨骼数据 */
96
- LibSpine.prototype.setSkin = function (skinName) {
96
+ LibPixiSpine.prototype.setSkin = function (skinName) {
97
97
  this.skeleton.setSkinByName(skinName);
98
98
  };
99
99
  /** @description 销毁动画及挂点 */
100
- LibSpine.prototype.destroyAll = function () {
100
+ LibPixiSpine.prototype.destroyAll = function () {
101
101
  Ticker.system.remove(this._loopFn);
102
102
  this.destroy();
103
103
  this.removeFromParent();
104
104
  };
105
105
  /** @description 更新渲染 */
106
- LibSpine.prototype._loop = function () {
106
+ LibPixiSpine.prototype._loop = function () {
107
107
  this.update(Ticker.system.deltaMS / 1000);
108
108
  this._updateFollowPoint();
109
109
  };
110
110
  /** @description 更新挂点 */
111
- LibSpine.prototype._updateFollowPoint = function () {
111
+ LibPixiSpine.prototype._updateFollowPoint = function () {
112
112
  if (this._followDots.length === 0)
113
113
  return;
114
114
  this._followDots.forEach(function (item) {
@@ -146,6 +146,6 @@ var LibSpine = /** @class */ (function (_super) {
146
146
  });
147
147
  }
148
148
  };
149
- return LibSpine;
149
+ return LibPixiSpine;
150
150
  }(Spine));
151
- export { LibSpine };
151
+ export { LibPixiSpine };
@@ -1,5 +1,5 @@
1
1
  import { Text, type TextStyleAlign, type TextStyleFontWeight } from "pixi.js";
2
- export interface LibTextParams {
2
+ export interface LibPixiTextParams {
3
3
  /** 文本内容 */
4
4
  text: string | number;
5
5
  /** 字体大小 */
@@ -30,6 +30,6 @@ export interface LibTextParams {
30
30
  shadow?: [string, number, number, number];
31
31
  }
32
32
  /** @description 自定义文本类 */
33
- export declare class LibText extends Text {
34
- constructor(options: LibTextParams);
33
+ export declare class LibPixiText extends Text {
34
+ constructor(options: LibPixiTextParams);
35
35
  }
@@ -15,9 +15,9 @@ var __extends = (this && this.__extends) || (function () {
15
15
  })();
16
16
  import { Text, TextStyle } from "pixi.js";
17
17
  /** @description 自定义文本类 */
18
- var LibText = /** @class */ (function (_super) {
19
- __extends(LibText, _super);
20
- function LibText(options) {
18
+ var LibPixiText = /** @class */ (function (_super) {
19
+ __extends(LibPixiText, _super);
20
+ function LibPixiText(options) {
21
21
  var _this = this;
22
22
  var text = options.text, _a = options.fontSize, fontSize = _a === void 0 ? 36 : _a, _b = options.fontColor, fontColor = _b === void 0 ? 0xffffff : _b, stroke = options.stroke, strokeColor = options.strokeColor, strokeThickness = options.strokeThickness, _c = options.fontFamily, fontFamily = _c === void 0 ? "MicrosoftYaHei" : _c, _d = options.fontWeight, fontWeight = _d === void 0 ? "normal" : _d, _e = options.wordWrap, wordWrap = _e === void 0 ? false : _e, _f = options.wordWrapWidth, wordWrapWidth = _f === void 0 ? 100 : _f, _g = options.lineHeight, lineHeight = _g === void 0 ? 1.25 : _g, _h = options.align, align = _h === void 0 ? "left" : _h, _j = options.indent, indent = _j === void 0 ? 0 : _j, shadow = options.shadow;
23
23
  var style = new TextStyle({
@@ -45,6 +45,6 @@ var LibText = /** @class */ (function (_super) {
45
45
  _this.position.x = indent * fontSize;
46
46
  return _this;
47
47
  }
48
- return LibText;
48
+ return LibPixiText;
49
49
  }(Text));
50
- export { LibText };
50
+ export { LibPixiText };
@@ -1,21 +1,21 @@
1
- import { LibBitText } from "./Base/LibBitText";
2
- import { LibContainer } from "./Base/LibContainer";
3
- import { LibParticleMove } from "./Base/LibParticleMove";
4
- import { LibRectBgColor } from "./Base/LibRectBgColor";
5
- import { LibSpine } from "./Base/LibSpine";
6
- import { LibText } from "./Base/LibText";
1
+ import { LibPixiBitText } from "./Base/LibPixiBitText";
2
+ import { LibPixiContainer } from "./Base/LibPixiContainer";
3
+ import { LibPixiParticleMove } from "./Base/LibPixiParticleMove";
4
+ import { LibPixiRectBgColor } from "./Base/LibPixiRectBgColor";
5
+ import { LibPixiSpine } from "./Base/LibPixiSpine";
6
+ import { LibPixiText } from "./Base/LibPixiText";
7
7
  /** @description 基础方法 */
8
8
  export declare const Base: {
9
9
  /** @description 自定义位图文本 */
10
- LibBitText: typeof LibBitText;
10
+ LibPixiBitText: typeof LibPixiBitText;
11
11
  /** @description 自定义容器大小及背景色 */
12
- LibContainer: typeof LibContainer;
12
+ LibPixiContainer: typeof LibPixiContainer;
13
13
  /** @description 粒子移动 */
14
- LibParticleMove: typeof LibParticleMove;
14
+ LibPixiParticleMove: typeof LibPixiParticleMove;
15
15
  /** @description 自定义矩形背景色 */
16
- LibRectBgColor: typeof LibRectBgColor;
16
+ LibPixiRectBgColor: typeof LibPixiRectBgColor;
17
17
  /** @description 自定义 Spine 动画 */
18
- LibSpine: typeof LibSpine;
18
+ LibPixiSpine: typeof LibPixiSpine;
19
19
  /** @description 自定义普通文本类 */
20
- LibText: typeof LibText;
20
+ LibPixiText: typeof LibPixiText;
21
21
  };
package/dist/libPixiJs.js CHANGED
@@ -1,21 +1,21 @@
1
- import { LibBitText } from "./Base/LibBitText";
2
- import { LibContainer } from "./Base/LibContainer";
3
- import { LibParticleMove } from "./Base/LibParticleMove";
4
- import { LibRectBgColor } from "./Base/LibRectBgColor";
5
- import { LibSpine } from "./Base/LibSpine";
6
- import { LibText } from "./Base/LibText";
1
+ import { LibPixiBitText } from "./Base/LibPixiBitText";
2
+ import { LibPixiContainer } from "./Base/LibPixiContainer";
3
+ import { LibPixiParticleMove } from "./Base/LibPixiParticleMove";
4
+ import { LibPixiRectBgColor } from "./Base/LibPixiRectBgColor";
5
+ import { LibPixiSpine } from "./Base/LibPixiSpine";
6
+ import { LibPixiText } from "./Base/LibPixiText";
7
7
  /** @description 基础方法 */
8
8
  export var Base = {
9
9
  /** @description 自定义位图文本 */
10
- LibBitText: LibBitText,
10
+ LibPixiBitText: LibPixiBitText,
11
11
  /** @description 自定义容器大小及背景色 */
12
- LibContainer: LibContainer,
12
+ LibPixiContainer: LibPixiContainer,
13
13
  /** @description 粒子移动 */
14
- LibParticleMove: LibParticleMove,
14
+ LibPixiParticleMove: LibPixiParticleMove,
15
15
  /** @description 自定义矩形背景色 */
16
- LibRectBgColor: LibRectBgColor,
16
+ LibPixiRectBgColor: LibPixiRectBgColor,
17
17
  /** @description 自定义 Spine 动画 */
18
- LibSpine: LibSpine,
18
+ LibPixiSpine: LibPixiSpine,
19
19
  /** @description 自定义普通文本类 */
20
- LibText: LibText,
20
+ LibPixiText: LibPixiText,
21
21
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "type": "module",
7
7
  "types": "./dist/index.d.ts",
8
8
  "main": "./dist/index.js",
9
9
  "scripts": {
10
- "build": "tsc & vite build"
10
+ "build": "vite build & tsc"
11
11
  },
12
12
  "exports": {
13
13
  "./*": "./dist/*"
@@ -45,4 +45,4 @@
45
45
  "pixi.js": "^7.4.2",
46
46
  "vite": "^4.5.5"
47
47
  }
48
- }
48
+ }