lyb-pixi-js 1.12.60 → 1.12.61
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/Components/Custom/LibPixiArrangeLinearV2.js +2 -2
- package/Components/Custom/LibPixiGridColumnLayout.js +2 -2
- package/Components/Custom/LibPixiGridRowLayout.js +2 -2
- package/Components/Custom/LibPixiTextGroupWrap.js +2 -2
- package/README.md +6 -0
- package/Utils/LibPixiActhor.d.ts +3 -0
- package/Utils/LibPixiActhor.js +6 -0
- package/Utils/LibPixiDialogManager/ui/LibPixiDialog.js +2 -4
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Container } from "pixi.js";
|
|
2
|
+
import { libPixiPivot } from "../../Utils/LibPixiActhor";
|
|
2
3
|
/** @description 线性排列 */
|
|
3
4
|
export class LibPixiArrangeLinearV2 extends Container {
|
|
4
5
|
constructor(params) {
|
|
@@ -63,8 +64,7 @@ export class LibPixiArrangeLinearV2 extends Container {
|
|
|
63
64
|
lastRowMax = Math.max(lastRowMax, item.width);
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
-
this.pivot.set(bounds.x + bounds.width * anchorX, bounds.y + bounds.height * anchorY);
|
|
67
|
+
libPixiPivot(this, anchorX, anchorY);
|
|
68
68
|
}
|
|
69
69
|
/** @description 获取列表元素 */
|
|
70
70
|
getList() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Container } from "pixi.js";
|
|
2
|
+
import { libPixiPivot } from "../../Utils/LibPixiActhor";
|
|
2
3
|
/** @description 网格列布局 */
|
|
3
4
|
export class LibPixiGridColumnLayout extends Container {
|
|
4
5
|
constructor(params) {
|
|
@@ -23,8 +24,7 @@ export class LibPixiGridColumnLayout extends Container {
|
|
|
23
24
|
item.x = isRTL ? -col * colGap : col * colGap;
|
|
24
25
|
item.y = row * rowGap;
|
|
25
26
|
});
|
|
26
|
-
|
|
27
|
-
this.pivot.set(bounds.x + bounds.width * anchorX, bounds.y + bounds.height * anchorY);
|
|
27
|
+
libPixiPivot(this, anchorX, anchorY);
|
|
28
28
|
}
|
|
29
29
|
/** @description 获取列表元素 */
|
|
30
30
|
getList() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Container } from "pixi.js";
|
|
2
|
+
import { libPixiPivot } from "../../Utils/LibPixiActhor";
|
|
2
3
|
/** @description 网格行布局 */
|
|
3
4
|
export class LibPixiGridRowLayout extends Container {
|
|
4
5
|
constructor(params) {
|
|
@@ -23,8 +24,7 @@ export class LibPixiGridRowLayout extends Container {
|
|
|
23
24
|
item.y = row * rowGap;
|
|
24
25
|
});
|
|
25
26
|
// 根据 anchor 调整整体偏移
|
|
26
|
-
|
|
27
|
-
this.pivot.set(bounds.x + bounds.width * anchorX, bounds.y + bounds.height * anchorY);
|
|
27
|
+
libPixiPivot(this, anchorX, anchorY);
|
|
28
28
|
}
|
|
29
29
|
/** @description 获取列表元素 */
|
|
30
30
|
getList() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Container, Text } from "pixi.js";
|
|
2
|
+
import { libPixiPivot } from "../../Utils/LibPixiActhor";
|
|
2
3
|
/** @description 文本组换行 */
|
|
3
4
|
export class LibPixiTextGroupWrap extends Container {
|
|
4
5
|
constructor({ items, defaultStyle = {}, wordWrapWidth, paddingX = 0, paddingY = 0, align = "left", anchorX = 0, anchorY = 0, }) {
|
|
@@ -44,7 +45,6 @@ export class LibPixiTextGroupWrap extends Container {
|
|
|
44
45
|
y += maxHeight + paddingY;
|
|
45
46
|
}
|
|
46
47
|
// 根据 anchor 调整整体偏移
|
|
47
|
-
|
|
48
|
-
this.pivot.set(bounds.x + bounds.width * anchorX, bounds.y + bounds.height * anchorY);
|
|
48
|
+
libPixiPivot(this, anchorX, anchorY);
|
|
49
49
|
}
|
|
50
50
|
}
|
package/README.md
CHANGED
|
@@ -198,6 +198,8 @@ app.stage.addChild(box);
|
|
|
198
198
|
|
|
199
199
|
\- [LibPixiTicker-Ticker管理器](#LibPixiTicker-Ticker管理器)
|
|
200
200
|
|
|
201
|
+
\- [LibPixiPivot-容器锚点设置](#LibPixiPivot-容器锚点设置)
|
|
202
|
+
|
|
201
203
|
## Base-基础
|
|
202
204
|
|
|
203
205
|
### LibPixiText-文本
|
|
@@ -1270,3 +1272,7 @@ LibPixiEmitContainerEvent(this, "EVENT_NAME", {});
|
|
|
1270
1272
|
### LibPixiTicker-Ticker管理器
|
|
1271
1273
|
|
|
1272
1274
|
> 添加和删除 `Ticker` 函数,单个 `Ticker` 函数暂停开始,所有 `Ticker` 函数使用的是全局的 `Ticker`
|
|
1275
|
+
|
|
1276
|
+
### LibPixiPivot-容器锚点设置
|
|
1277
|
+
|
|
1278
|
+
> 给容器设置精准的 `Pivot`,但当容器大小改变时,需要重新调用
|
|
@@ -14,6 +14,7 @@ import { LibPixiMaskBg } from "../../../Components/Custom/LibPixiMaskBg";
|
|
|
14
14
|
import { libPixiEvent } from "../../LibPixiEvent";
|
|
15
15
|
import { LibPixiBaseContainer } from "./LibPixiBaseContainer";
|
|
16
16
|
import { LibPixiTicker } from "../../LibPixiTicker";
|
|
17
|
+
import { libPixiPivot } from "../../LibPixiActhor";
|
|
17
18
|
/** @description 弹窗组件 */
|
|
18
19
|
export class LibPixiDialog extends LibPixiBaseContainer {
|
|
19
20
|
constructor(params) {
|
|
@@ -79,10 +80,7 @@ export class LibPixiDialog extends LibPixiBaseContainer {
|
|
|
79
80
|
}
|
|
80
81
|
/** @description 更新弹窗容器坐标 */
|
|
81
82
|
updatePosition(w, h) {
|
|
82
|
-
|
|
83
|
-
const dialogW = bounds.width / 2;
|
|
84
|
-
const dialogH = bounds.height / 2;
|
|
85
|
-
this._dialogContainer.pivot.set(bounds.x + dialogW, bounds.y + dialogH);
|
|
83
|
+
libPixiPivot(this._dialogContainer, 0.5, 0.5);
|
|
86
84
|
const halfW = 1920 / 2;
|
|
87
85
|
const halfH = 1080 / 2;
|
|
88
86
|
if (w > h) {
|