lyb-pixi-js 1.7.5 → 1.7.7

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,35 @@
1
+ import { HTMLText, type TextStyleAlign, type TextStyleFontWeight } from "pixi.js";
2
+ export interface LibPixiHtmlTextParams {
3
+ /** 文本内容 */
4
+ text: string | number;
5
+ /** 字体大小 */
6
+ fontSize?: number;
7
+ /** 字体颜色 */
8
+ fontColor?: any;
9
+ /** 是否描边 */
10
+ stroke?: boolean;
11
+ /** 描边颜色 */
12
+ strokeColor?: string | number;
13
+ /** 描边宽度 */
14
+ strokeThickness?: number;
15
+ /** 字体样式 */
16
+ fontFamily?: string;
17
+ /** 字体粗细 */
18
+ fontWeight?: TextStyleFontWeight;
19
+ /** 是否换行 */
20
+ wordWrap?: boolean;
21
+ /** 换行宽度 */
22
+ wordWrapWidth?: number;
23
+ /** 行高 */
24
+ lineHeight?: number;
25
+ /** 对齐方式 */
26
+ align?: TextStyleAlign;
27
+ /** 阴影-颜色 角度 模糊度 阴影距离 */
28
+ shadow?: [string, number, number, number];
29
+ }
30
+ /** @description 自定义富文本类
31
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiHtmlText-富文本
32
+ */
33
+ export declare class LibPixiHtmlText extends HTMLText {
34
+ constructor(options: LibPixiHtmlTextParams);
35
+ }
@@ -0,0 +1,30 @@
1
+ import { HTMLText, } from "pixi.js";
2
+ /** @description 自定义富文本类
3
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiHtmlText-富文本
4
+ */
5
+ export class LibPixiHtmlText extends HTMLText {
6
+ constructor(options) {
7
+ const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeColor, strokeThickness, fontFamily = "Arial", fontWeight = "normal", wordWrap = false, wordWrapWidth = 100, lineHeight = 1.25, align = "left", shadow, } = options;
8
+ super(text.toString(), {
9
+ fontSize,
10
+ wordWrap,
11
+ wordWrapWidth,
12
+ fontWeight,
13
+ lineHeight: lineHeight * fontSize,
14
+ breakWords: wordWrap,
15
+ fill: fontColor,
16
+ align,
17
+ whiteSpace: "normal",
18
+ fontFamily: fontFamily,
19
+ stroke: stroke ? strokeColor : "transparent",
20
+ strokeThickness: stroke ? strokeThickness : 0,
21
+ });
22
+ if (shadow) {
23
+ this.style.dropShadow = true;
24
+ this.style.dropShadowColor = shadow[0];
25
+ this.style.dropShadowAngle = shadow[1] * (Math.PI / 180);
26
+ this.style.dropShadowBlur = shadow[2];
27
+ this.style.dropShadowDistance = shadow[3];
28
+ }
29
+ }
30
+ }
package/README.md CHANGED
@@ -84,6 +84,8 @@ app.stage.addChild(box);
84
84
 
85
85
  \- [LibPixiText-文本](#LibPixiText-文本)
86
86
 
87
+ \- [LibPixiHtmlText-富文本](#LibPixiHtmlText-富文本)
88
+
87
89
  \- [LibPixiBitText-位图](#LibPixiBitText-位图)
88
90
 
89
91
  \- [LibPixiContainer-容器](#LibPixiContainer-容器)
@@ -104,9 +106,9 @@ app.stage.addChild(box);
104
106
 
105
107
  \- [LibPixiProgress-进度条](#LibPixiProgress-进度条)
106
108
 
107
- \- [LibPixiScrollContainerX-X轴滚动容器](#LibPixiScrollContainerX-X轴滚动容器)
109
+ \- [LibPixiScrollContainerX-X 轴滚动容器](#LibPixiScrollContainerX-X轴滚动容器)
108
110
 
109
- \- [LibPixiScrollContainerY-Y轴滚动容器](#LibPixiScrollContainerY-Y轴滚动容器)
111
+ \- [LibPixiScrollContainerY-Y 轴滚动容器](#LibPixiScrollContainerY-Y轴滚动容器)
110
112
 
111
113
  \- [LibPixiScrollNum-数字滑动](#LibPixiScrollNum-数字滑动)
112
114
 
@@ -190,15 +192,53 @@ interface LibPixiTextParams {
190
192
  }
191
193
  ```
192
194
 
195
+ ### LibPixiHtmlText-富文本
196
+
197
+ > 自定义富文本类
198
+
199
+ ```ts
200
+ const text = new LibPixiHtmlText(LibPixiTextParams);
201
+ this.addChild(text);
202
+
203
+ interface LibPixiHtmlTextParams {
204
+ /** 文本内容 */
205
+ text: string | number;
206
+ /** 字体大小 */
207
+ fontSize?: number;
208
+ /** 字体颜色 */
209
+ fontColor?: any;
210
+ /** 是否描边 */
211
+ stroke?: boolean;
212
+ /** 描边颜色 */
213
+ strokeColor?: string | number;
214
+ /** 描边宽度 */
215
+ strokeThickness?: number;
216
+ /** 字体样式 */
217
+ fontFamily?: string;
218
+ /** 字体粗细 */
219
+ fontWeight?: TextStyleFontWeight;
220
+ /** 是否换行 */
221
+ wordWrap?: boolean;
222
+ /** 换行宽度 */
223
+ wordWrapWidth?: number;
224
+ /** 行高 */
225
+ lineHeight?: number;
226
+ /** 对齐方式 */
227
+ align?: TextStyleAlign;
228
+ /** 阴影-颜色 角度 模糊度 阴影距离 */
229
+ shadow?: [string, number, number, number];
230
+ }
231
+ ```
232
+
193
233
  ### LibPixiBitText-位图
194
234
 
195
235
  > 自定义位图文本
196
236
 
197
237
  ```ts
198
238
  /**
199
- * @param fontName 字体名称
200
- * @param defaultFontSize 默认字体大小
201
- */
239
+ * @param fontName 字体名称
240
+ * @param defaultFontSize 默认字体大小
241
+ */
202
242
 
203
243
  //所有文字使用同一个字体大小
204
244
  const font = new LibPixiBitText("FontName", 16);
@@ -219,11 +259,11 @@ this.addChild(fontText2);
219
259
 
220
260
  ```ts
221
261
  /**
222
- * @param width 容器宽度
223
- * @param height 容器高度
224
- * @param bgColor 背景色
225
- * @param overHidden 是否溢出裁剪
226
- */
262
+ * @param width 容器宽度
263
+ * @param height 容器高度
264
+ * @param bgColor 背景色
265
+ * @param overHidden 是否溢出裁剪
266
+ */
227
267
  const box = new LibPixiJs.Base.LibPixiContainer(100, 100, "#fff", true);
228
268
  this.addChild(box);
229
269
  ```
@@ -320,60 +360,60 @@ interface LibPixiSpineParams {
320
360
  > 利用贝塞尔曲线实现粒子移动
321
361
 
322
362
  ```ts
323
- const libParticleMove = new LibPixiJs.Components.Base.LibPixiParticleMove({
324
- start: { x: 0, y: window.innerHeight },
325
- control: [
326
- { x: 1000, y: 750 },
327
- { x: 500, y: 250 },
328
- ],
329
- end: { x: 0, y: 0 },
330
- container: PIXI.Assets.get("fly.png"),
331
- duration: 1,
332
- showControl: true,
333
- ease: "power1.in",
334
- particleConfig: {
335
- frequency: 0.001,
336
- blendMode: "add",
337
- lifetime: {
338
- min: 0.01,
339
- max: 1,
340
- },
341
- alpha: {
342
- start: 1,
343
- end: 0,
344
- },
345
- color: {
346
- start: "#fff96c",
347
- end: "#ff837f",
348
- },
349
- scale: {
350
- start: 2,
351
- end: 3,
352
- },
353
- rotation: {
354
- min: 0,
355
- max: 360,
356
- },
357
- rotate: {
358
- min: 0,
359
- max: 360,
360
- },
361
- speed: {
362
- start: 0,
363
- end: 0,
364
- },
363
+ const libParticleMove = new LibPixiJs.Components.Base.LibPixiParticleMove({
364
+ start: { x: 0, y: window.innerHeight },
365
+ control: [
366
+ { x: 1000, y: 750 },
367
+ { x: 500, y: 250 },
368
+ ],
369
+ end: { x: 0, y: 0 },
370
+ container: PIXI.Assets.get("fly.png"),
371
+ duration: 1,
372
+ showControl: true,
373
+ ease: "power1.in",
374
+ particleConfig: {
375
+ frequency: 0.001,
376
+ blendMode: "add",
377
+ lifetime: {
378
+ min: 0.01,
379
+ max: 1,
365
380
  },
381
+ alpha: {
382
+ start: 1,
383
+ end: 0,
384
+ },
385
+ color: {
386
+ start: "#fff96c",
387
+ end: "#ff837f",
388
+ },
389
+ scale: {
390
+ start: 2,
391
+ end: 3,
392
+ },
393
+ rotation: {
394
+ min: 0,
395
+ max: 360,
396
+ },
397
+ rotate: {
398
+ min: 0,
399
+ max: 360,
400
+ },
401
+ speed: {
402
+ start: 0,
403
+ end: 0,
404
+ },
405
+ },
366
406
 
367
- onDestroy: (destroy) => {
368
- gsap.to(libParticleMove, {
369
- alpha: 0,
370
- onComplete: () => {
371
- destroy()
372
- }
373
- })
374
- }
375
- });
376
- app.stage.addChild(libParticleMove);
407
+ onDestroy: (destroy) => {
408
+ gsap.to(libParticleMove, {
409
+ alpha: 0,
410
+ onComplete: () => {
411
+ destroy();
412
+ },
413
+ });
414
+ },
415
+ });
416
+ app.stage.addChild(libParticleMove);
377
417
 
378
418
  export interface LibPixiParticleMoveParams {
379
419
  /** 粒子JSON资源 */
@@ -579,7 +619,7 @@ progress.setProgress(0.5); //50% 完成
579
619
  app.stage.addChild(progress);
580
620
  ```
581
621
 
582
- ### LibPixiScrollContainerX-X轴滚动容器
622
+ ### LibPixiScrollContainerX-X 轴滚动容器
583
623
 
584
624
  > 支持鼠标滚轮滚动、鼠标拖动、手指滑动,支持惯性滚动及回弹
585
625
 
@@ -609,7 +649,7 @@ scrollContainer.setDimensions(800, 600);
609
649
  scrollContainer.addContent(new Sprite(Texture.from("new-content.png")));
610
650
  ```
611
651
 
612
- ### LibPixiScrollContainerY-Y轴滚动容器
652
+ ### LibPixiScrollContainerY-Y 轴滚动容器
613
653
 
614
654
  > 支持鼠标滚轮滚动、鼠标拖动、手指滑动,支持惯性滚动及回弹
615
655
 
@@ -1048,4 +1088,4 @@ $bus.on("play", () => {
1048
1088
 
1049
1089
  ```ts
1050
1090
  new LibPixiPolygonDrawTool(app);
1051
- ```
1091
+ ```
package/libPixiJs.d.ts CHANGED
@@ -19,6 +19,7 @@ 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
23
  /** @description 组件 */
23
24
  export declare const Components: {
24
25
  Base: {
@@ -46,6 +47,10 @@ export declare const Components: {
46
47
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiText-文本
47
48
  */
48
49
  LibPixiText: typeof LibPixiText;
50
+ /** @description 自定义富文本类
51
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiHtmlText-自定义富文本类
52
+ */
53
+ LibPixiHtmlText: typeof LibPixiHtmlText;
49
54
  };
50
55
  Custom: {
51
56
  /** @description 悬浮切换材质
package/libPixiJs.js CHANGED
@@ -29,6 +29,7 @@ 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
33
  /** @description 组件 */
33
34
  export const Components = {
34
35
  Base: {
@@ -56,6 +57,10 @@ export const Components = {
56
57
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiText-文本
57
58
  */
58
59
  LibPixiText,
60
+ /** @description 自定义富文本类
61
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiHtmlText-自定义富文本类
62
+ */
63
+ LibPixiHtmlText,
59
64
  },
60
65
  Custom: {
61
66
  /** @description 悬浮切换材质
package/lyb-pixi.js CHANGED
@@ -1315,7 +1315,7 @@
1315
1315
  var ys = arrObjKeys(obj, inspect2);
1316
1316
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
1317
1317
  var protoTag = obj instanceof Object ? "" : "null prototype";
1318
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
1318
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
1319
1319
  var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
1320
1320
  var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
1321
1321
  if (ys.length === 0) {
@@ -1337,25 +1337,25 @@
1337
1337
  return $replace$1.call(String(s2), /"/g, """);
1338
1338
  }
1339
1339
  function isArray$3(obj) {
1340
- return toStr$1(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1340
+ return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1341
1341
  }
1342
1342
  function isDate(obj) {
1343
- return toStr$1(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1343
+ return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1344
1344
  }
1345
1345
  function isRegExp$1(obj) {
1346
- return toStr$1(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1346
+ return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1347
1347
  }
1348
1348
  function isError(obj) {
1349
- return toStr$1(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1349
+ return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1350
1350
  }
1351
1351
  function isString(obj) {
1352
- return toStr$1(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1352
+ return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1353
1353
  }
1354
1354
  function isNumber(obj) {
1355
- return toStr$1(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1355
+ return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1356
1356
  }
1357
1357
  function isBoolean(obj) {
1358
- return toStr$1(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1358
+ return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
1359
1359
  }
1360
1360
  function isSymbol(obj) {
1361
1361
  if (hasShammedSymbols) {
@@ -1391,7 +1391,7 @@
1391
1391
  function has$3(obj, key) {
1392
1392
  return hasOwn$1.call(obj, key);
1393
1393
  }
1394
- function toStr$1(obj) {
1394
+ function toStr(obj) {
1395
1395
  return objectToString.call(obj);
1396
1396
  }
1397
1397
  function nameOf(f2) {
@@ -1700,7 +1700,7 @@
1700
1700
  var uri = URIError;
1701
1701
  var abs$1 = Math.abs;
1702
1702
  var floor$1 = Math.floor;
1703
- var max$2 = Math.max;
1703
+ var max$1 = Math.max;
1704
1704
  var min$1 = Math.min;
1705
1705
  var pow$1 = Math.pow;
1706
1706
  var round$2 = Math.round;
@@ -1833,78 +1833,102 @@
1833
1833
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
1834
1834
  return Object_getPrototypeOf;
1835
1835
  }
1836
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
1837
- var toStr = Object.prototype.toString;
1838
- var max$1 = Math.max;
1839
- var funcType = "[object Function]";
1840
- var concatty = function concatty2(a2, b2) {
1841
- var arr = [];
1842
- for (var i2 = 0; i2 < a2.length; i2 += 1) {
1843
- arr[i2] = a2[i2];
1844
- }
1845
- for (var j2 = 0; j2 < b2.length; j2 += 1) {
1846
- arr[j2 + a2.length] = b2[j2];
1847
- }
1848
- return arr;
1849
- };
1850
- var slicy = function slicy2(arrLike, offset) {
1851
- var arr = [];
1852
- for (var i2 = offset || 0, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
1853
- arr[j2] = arrLike[i2];
1854
- }
1855
- return arr;
1856
- };
1857
- var joiny = function(arr, joiner) {
1858
- var str = "";
1859
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
1860
- str += arr[i2];
1861
- if (i2 + 1 < arr.length) {
1862
- str += joiner;
1836
+ var implementation;
1837
+ var hasRequiredImplementation;
1838
+ function requireImplementation() {
1839
+ if (hasRequiredImplementation)
1840
+ return implementation;
1841
+ hasRequiredImplementation = 1;
1842
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
1843
+ var toStr2 = Object.prototype.toString;
1844
+ var max2 = Math.max;
1845
+ var funcType = "[object Function]";
1846
+ var concatty = function concatty2(a2, b2) {
1847
+ var arr = [];
1848
+ for (var i2 = 0; i2 < a2.length; i2 += 1) {
1849
+ arr[i2] = a2[i2];
1863
1850
  }
1864
- }
1865
- return str;
1866
- };
1867
- var implementation$1 = function bind2(that) {
1868
- var target = this;
1869
- if (typeof target !== "function" || toStr.apply(target) !== funcType) {
1870
- throw new TypeError(ERROR_MESSAGE + target);
1871
- }
1872
- var args = slicy(arguments, 1);
1873
- var bound;
1874
- var binder = function() {
1875
- if (this instanceof bound) {
1876
- var result = target.apply(
1877
- this,
1878
- concatty(args, arguments)
1879
- );
1880
- if (Object(result) === result) {
1881
- return result;
1851
+ for (var j2 = 0; j2 < b2.length; j2 += 1) {
1852
+ arr[j2 + a2.length] = b2[j2];
1853
+ }
1854
+ return arr;
1855
+ };
1856
+ var slicy = function slicy2(arrLike, offset) {
1857
+ var arr = [];
1858
+ for (var i2 = offset || 0, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
1859
+ arr[j2] = arrLike[i2];
1860
+ }
1861
+ return arr;
1862
+ };
1863
+ var joiny = function(arr, joiner) {
1864
+ var str = "";
1865
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
1866
+ str += arr[i2];
1867
+ if (i2 + 1 < arr.length) {
1868
+ str += joiner;
1882
1869
  }
1883
- return this;
1884
1870
  }
1885
- return target.apply(
1886
- that,
1887
- concatty(args, arguments)
1888
- );
1871
+ return str;
1889
1872
  };
1890
- var boundLength = max$1(0, target.length - args.length);
1891
- var boundArgs = [];
1892
- for (var i2 = 0; i2 < boundLength; i2++) {
1893
- boundArgs[i2] = "$" + i2;
1894
- }
1895
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
1896
- if (target.prototype) {
1897
- var Empty = function Empty2() {
1873
+ implementation = function bind2(that) {
1874
+ var target = this;
1875
+ if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
1876
+ throw new TypeError(ERROR_MESSAGE + target);
1877
+ }
1878
+ var args = slicy(arguments, 1);
1879
+ var bound;
1880
+ var binder = function() {
1881
+ if (this instanceof bound) {
1882
+ var result = target.apply(
1883
+ this,
1884
+ concatty(args, arguments)
1885
+ );
1886
+ if (Object(result) === result) {
1887
+ return result;
1888
+ }
1889
+ return this;
1890
+ }
1891
+ return target.apply(
1892
+ that,
1893
+ concatty(args, arguments)
1894
+ );
1898
1895
  };
1899
- Empty.prototype = target.prototype;
1900
- bound.prototype = new Empty();
1901
- Empty.prototype = null;
1902
- }
1903
- return bound;
1904
- };
1905
- var implementation = implementation$1;
1906
- var functionBind = Function.prototype.bind || implementation;
1907
- var functionCall = Function.prototype.call;
1896
+ var boundLength = max2(0, target.length - args.length);
1897
+ var boundArgs = [];
1898
+ for (var i2 = 0; i2 < boundLength; i2++) {
1899
+ boundArgs[i2] = "$" + i2;
1900
+ }
1901
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
1902
+ if (target.prototype) {
1903
+ var Empty = function Empty2() {
1904
+ };
1905
+ Empty.prototype = target.prototype;
1906
+ bound.prototype = new Empty();
1907
+ Empty.prototype = null;
1908
+ }
1909
+ return bound;
1910
+ };
1911
+ return implementation;
1912
+ }
1913
+ var functionBind;
1914
+ var hasRequiredFunctionBind;
1915
+ function requireFunctionBind() {
1916
+ if (hasRequiredFunctionBind)
1917
+ return functionBind;
1918
+ hasRequiredFunctionBind = 1;
1919
+ var implementation2 = requireImplementation();
1920
+ functionBind = Function.prototype.bind || implementation2;
1921
+ return functionBind;
1922
+ }
1923
+ var functionCall;
1924
+ var hasRequiredFunctionCall;
1925
+ function requireFunctionCall() {
1926
+ if (hasRequiredFunctionCall)
1927
+ return functionCall;
1928
+ hasRequiredFunctionCall = 1;
1929
+ functionCall = Function.prototype.call;
1930
+ return functionCall;
1931
+ }
1908
1932
  var functionApply;
1909
1933
  var hasRequiredFunctionApply;
1910
1934
  function requireFunctionApply() {
@@ -1915,14 +1939,14 @@
1915
1939
  return functionApply;
1916
1940
  }
1917
1941
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
1918
- var bind$2 = functionBind;
1942
+ var bind$2 = requireFunctionBind();
1919
1943
  var $apply$1 = requireFunctionApply();
1920
- var $call$2 = functionCall;
1944
+ var $call$2 = requireFunctionCall();
1921
1945
  var $reflectApply = reflectApply;
1922
1946
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
1923
- var bind$1 = functionBind;
1947
+ var bind$1 = requireFunctionBind();
1924
1948
  var $TypeError$4 = type;
1925
- var $call$1 = functionCall;
1949
+ var $call$1 = requireFunctionCall();
1926
1950
  var $actualApply = actualApply;
1927
1951
  var callBindApplyHelpers = function callBindBasic2(args) {
1928
1952
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -1991,7 +2015,7 @@
1991
2015
  hasRequiredHasown = 1;
1992
2016
  var call = Function.prototype.call;
1993
2017
  var $hasOwn = Object.prototype.hasOwnProperty;
1994
- var bind2 = functionBind;
2018
+ var bind2 = requireFunctionBind();
1995
2019
  hasown = bind2.call(call, $hasOwn);
1996
2020
  return hasown;
1997
2021
  }
@@ -2006,7 +2030,7 @@
2006
2030
  var $URIError = uri;
2007
2031
  var abs = abs$1;
2008
2032
  var floor = floor$1;
2009
- var max = max$2;
2033
+ var max = max$1;
2010
2034
  var min = min$1;
2011
2035
  var pow = pow$1;
2012
2036
  var round$1 = round$2;
@@ -2040,7 +2064,7 @@
2040
2064
  var $ObjectGPO = requireObject_getPrototypeOf();
2041
2065
  var $ReflectGPO = requireReflect_getPrototypeOf();
2042
2066
  var $apply = requireFunctionApply();
2043
- var $call = functionCall;
2067
+ var $call = requireFunctionCall();
2044
2068
  var needsEval = {};
2045
2069
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
2046
2070
  var INTRINSICS = {
@@ -2210,7 +2234,7 @@
2210
2234
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
2211
2235
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
2212
2236
  };
2213
- var bind = functionBind;
2237
+ var bind = requireFunctionBind();
2214
2238
  var hasOwn = requireHasown();
2215
2239
  var $concat = bind.call($call, Array.prototype.concat);
2216
2240
  var $spliceApply = bind.call($apply, Array.prototype.splice);
@@ -25679,6 +25703,7 @@ void main(void)\r
25679
25703
  _HTMLText.defaultMaxWidth = 2024, /** Default maxHeight, set at construction */
25680
25704
  _HTMLText.defaultMaxHeight = 2024, /** Default autoResolution for all HTMLText objects */
25681
25705
  _HTMLText.defaultAutoResolution = true;
25706
+ let HTMLText = _HTMLText;
25682
25707
  class LibPixiBitText {
25683
25708
  /**
25684
25709
  * @param fontName 字体名称
@@ -54812,6 +54837,46 @@ void main(void){
54812
54837
  return pointElement;
54813
54838
  }
54814
54839
  }
54840
+ class LibPixiHtmlText extends HTMLText {
54841
+ constructor(options) {
54842
+ const {
54843
+ text,
54844
+ fontSize = 36,
54845
+ fontColor = 16777215,
54846
+ stroke,
54847
+ strokeColor,
54848
+ strokeThickness,
54849
+ fontFamily = "Arial",
54850
+ fontWeight = "normal",
54851
+ wordWrap = false,
54852
+ wordWrapWidth = 100,
54853
+ lineHeight = 1.25,
54854
+ align = "left",
54855
+ shadow
54856
+ } = options;
54857
+ super(text.toString(), {
54858
+ fontSize,
54859
+ wordWrap,
54860
+ wordWrapWidth,
54861
+ fontWeight,
54862
+ lineHeight: lineHeight * fontSize,
54863
+ breakWords: wordWrap,
54864
+ fill: fontColor,
54865
+ align,
54866
+ whiteSpace: "normal",
54867
+ fontFamily,
54868
+ stroke: stroke ? strokeColor : "transparent",
54869
+ strokeThickness: stroke ? strokeThickness : 0
54870
+ });
54871
+ if (shadow) {
54872
+ this.style.dropShadow = true;
54873
+ this.style.dropShadowColor = shadow[0];
54874
+ this.style.dropShadowAngle = shadow[1] * (Math.PI / 180);
54875
+ this.style.dropShadowBlur = shadow[2];
54876
+ this.style.dropShadowDistance = shadow[3];
54877
+ }
54878
+ }
54879
+ }
54815
54880
  const Components = {
54816
54881
  Base: {
54817
54882
  /** @description 自定义位图文本
@@ -54837,7 +54902,11 @@ void main(void){
54837
54902
  /** @description 自定义文本类
54838
54903
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiText-文本
54839
54904
  */
54840
- LibPixiText
54905
+ LibPixiText,
54906
+ /** @description 自定义富文本类
54907
+ * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiHtmlText-自定义富文本类
54908
+ */
54909
+ LibPixiHtmlText
54841
54910
  },
54842
54911
  Custom: {
54843
54912
  /** @description 悬浮切换材质
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "exports": {