lyb-pixi-js 1.12.34 → 1.12.35

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,18 @@
1
+ import { Container, type ITextStyle } from "pixi.js";
2
+ interface Params {
3
+ /** 文本列表 */
4
+ textList: {
5
+ type: "h" | "p";
6
+ text: string;
7
+ style?: Partial<ITextStyle>;
8
+ }[];
9
+ /** 内容宽度 */
10
+ width: number;
11
+ /** 默认样式 */
12
+ defaultStyle?: Partial<ITextStyle>;
13
+ }
14
+ /** @description 标题内容纵向排列 */
15
+ export declare class LibPixiHeadingParagraphLayout extends Container {
16
+ constructor(params: Params);
17
+ }
18
+ export {};
@@ -0,0 +1,27 @@
1
+ import { Container, Text } from "pixi.js";
2
+ /** @description 标题内容纵向排列 */
3
+ export class LibPixiHeadingParagraphLayout extends Container {
4
+ constructor(params) {
5
+ super();
6
+ const { textList, width, defaultStyle = {} } = params;
7
+ const textItemList = [];
8
+ let lastText;
9
+ textList.forEach((item, index) => {
10
+ const text = new Text(item.text, Object.assign(Object.assign({ wordWrap: true, wordWrapWidth: width }, defaultStyle), item.style));
11
+ this.addChild(text);
12
+ textItemList.push(text);
13
+ if (item.type === "h") {
14
+ text.anchor.x = 0.5;
15
+ text.x = width / 2;
16
+ text.style.align = "center";
17
+ }
18
+ if (lastText) {
19
+ text.y = lastText.y + lastText.height + Number(defaultStyle.fontSize) / 2;
20
+ }
21
+ if (item.type === "h" && index !== 0) {
22
+ text.y += Number(defaultStyle.fontSize);
23
+ }
24
+ lastText = text;
25
+ });
26
+ }
27
+ }
package/README.md CHANGED
@@ -156,6 +156,8 @@ app.stage.addChild(box);
156
156
 
157
157
  \- [LibPixiAreaClick-扩大点击范围](#LibPixiAreaClick-扩大点击范围)
158
158
 
159
+ \- [LibPixiHeadingParagraphLayout-文章标题内容布局](#LibPixiHeadingParagraphLayout-文章标题内容布局)
160
+
159
161
  ### 方法
160
162
 
161
163
  \- [LibPixiAudio-音频播放器](#LibPixiAudio-音频播放器)
@@ -921,6 +923,10 @@ const amountContainer = new LibLabelValue({
921
923
 
922
924
  > 解决当图片有空隙时,无法准确点击图片,如箭头和关闭按钮
923
925
 
926
+ ### LibPixiHeadingParagraphLayout-文章标题内容布局
927
+
928
+ > 只支持一个标题和一个内容,一般用于一些隐私政策和服务条款
929
+
924
930
  ## Utils-工具方法
925
931
 
926
932
  ### LibPixiAudio-音频播放器
@@ -104,6 +104,7 @@ export class LibPixiDialog extends LibPixiBaseContainer {
104
104
  close() {
105
105
  return __awaiter(this, void 0, void 0, function* () {
106
106
  var _a;
107
+ this._maskUI.eventMode = "none";
107
108
  (_a = this._offResize) === null || _a === void 0 ? void 0 : _a.call(this);
108
109
  gsap.to(this._dialogContainer.scale, {
109
110
  duration: LibPixiDialog.durationOut,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.12.34",
3
+ "version": "1.12.35",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "exports": {