lyb-pixi-js 1.12.81 → 1.12.82

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,5 @@
1
+ import { BitmapText } from "pixi.js";
2
+ /** @description 自定义位图文本 */
3
+ export declare class LibPixiBit extends BitmapText {
4
+ constructor(fontName: string, text: string | number, fontSize: number);
5
+ }
@@ -0,0 +1,10 @@
1
+ import { BitmapText } from "pixi.js";
2
+ /** @description 自定义位图文本 */
3
+ export class LibPixiBit extends BitmapText {
4
+ constructor(fontName, text, fontSize) {
5
+ super(text.toString(), {
6
+ fontName,
7
+ fontSize,
8
+ });
9
+ }
10
+ }
package/README.md CHANGED
@@ -86,6 +86,8 @@ app.stage.addChild(box);
86
86
 
87
87
  \- [LibPixiHtmlText-富文本](#LibPixiHtmlText-富文本)
88
88
 
89
+ \- [LibPixiBit-位图简化使用](#LibPixiBit-位图简化使用)
90
+
89
91
  \- [LibPixiBitText-位图](#LibPixiBitText-位图)
90
92
 
91
93
  \- [LibPixiContainer-容器](#LibPixiContainer-容器)
@@ -206,8 +208,6 @@ app.stage.addChild(box);
206
208
 
207
209
  \- [LibPixiIsOutOfView-离开可视区检测](#LibPixiIsOutOfView-离开可视区检测)
208
210
 
209
- \- [LibBitTextGroup-美术字组](#LibBitTextGroup-美术字组)
210
-
211
211
  ## Base-基础
212
212
 
213
213
  ### LibPixiText-文本
@@ -284,6 +284,8 @@ interface LibPixiHtmlTextParams {
284
284
  }
285
285
  ```
286
286
 
287
+ ### LibPixiBit-位图简化使用
288
+
287
289
  ### LibPixiBitText-位图
288
290
 
289
291
  > 自定义位图文本
@@ -1373,8 +1375,4 @@ LibPixiEmitContainerEvent(this, "EVENT_NAME", {});
1373
1375
 
1374
1376
  ### LibPixiIsOutOfView-离开可视区检测
1375
1377
 
1376
- > 检测元素是否离开可视区
1377
-
1378
- ### LibBitTextGroup-美术字组
1379
-
1380
- > 通过将美术字的 `fnt` 字体文件,循环创建位图文本进行拼接
1378
+ > 检测元素是否离开可视区
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.12.81",
3
+ "version": "1.12.82",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "exports": {
@@ -1,21 +0,0 @@
1
- import { Container } from "pixi.js";
2
- import { LibPixiArrangeLinearV2 } from "./LibPixiArrangeLinearV2";
3
- interface LibBitTextGroupParams {
4
- /** 字体 */
5
- family: string;
6
- /** 文本 */
7
- text: string;
8
- /** 字体大小 */
9
- fontSize: number;
10
- /** 间隔 */
11
- gap?: number;
12
- /** 锚点X */
13
- anchorX?: number;
14
- /** 锚点Y */
15
- anchorY?: number;
16
- }
17
- /** @description 美术字组 */
18
- export declare class LibBitTextGroup extends LibPixiArrangeLinearV2<Container> {
19
- constructor(params: LibBitTextGroupParams);
20
- }
21
- export {};
@@ -1,21 +0,0 @@
1
- import { LibPixiBitText } from "../Base/LibPixiBitText";
2
- import { LibPixiArrangeLinearV2 } from "./LibPixiArrangeLinearV2";
3
- /** @description 美术字组 */
4
- export class LibBitTextGroup extends LibPixiArrangeLinearV2 {
5
- constructor(params) {
6
- const { family, text, fontSize, gap = -3, anchorX = 0.5, anchorY = 0.5, } = params;
7
- super({
8
- direction: "x",
9
- gap,
10
- anchorX,
11
- anchorY,
12
- });
13
- const bit = new LibPixiBitText(family, fontSize);
14
- for (const char of text) {
15
- const bitText = bit.createText(char);
16
- bitText.anchor.y = 0.5;
17
- this.push(bit.createText(char));
18
- }
19
- this.layout();
20
- }
21
- }