lyb-pixi-js 1.12.39 → 1.12.40
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/package.json +1 -1
- package/Components/Base/LibPixiArc.d.ts +0 -16
- package/Components/Base/LibPixiArc.js +0 -14
- package/Components/Base/LibPixiBitText.d.ts +0 -20
- package/Components/Base/LibPixiBitText.js +0 -26
- package/Components/Base/LibPixiCircular.d.ts +0 -7
- package/Components/Base/LibPixiCircular.js +0 -12
- package/Components/Base/LibPixiContainer.d.ts +0 -22
- package/Components/Base/LibPixiContainer.js +0 -51
- package/Components/Base/LibPixiHtmlText.d.ts +0 -31
- package/Components/Base/LibPixiHtmlText.js +0 -30
- package/Components/Base/LibPixiOval.d.ts +0 -5
- package/Components/Base/LibPixiOval.js +0 -10
- package/Components/Base/LibPixiParticleMove.d.ts +0 -101
- package/Components/Base/LibPixiParticleMove.js +0 -136
- package/Components/Base/LibPixiPolygon.d.ts +0 -7
- package/Components/Base/LibPixiPolygon.js +0 -15
- package/Components/Base/LibPixiRectBgColor.d.ts +0 -41
- package/Components/Base/LibPixiRectBgColor.js +0 -95
- package/Components/Base/LibPixiRectangle.d.ts +0 -7
- package/Components/Base/LibPixiRectangle.js +0 -15
- package/Components/Base/LibPixiRound.d.ts +0 -5
- package/Components/Base/LibPixiRound.js +0 -9
- package/Components/Base/LibPixiRoundedRect.d.ts +0 -5
- package/Components/Base/LibPixiRoundedRect.js +0 -10
- package/Components/Base/LibPixiSpine.d.ts +0 -58
- package/Components/Base/LibPixiSpine.js +0 -128
- package/Components/Base/LibPixiText.d.ts +0 -37
- package/Components/Base/LibPixiText.js +0 -35
- package/Components/Custom/LibPixiAreaClick.d.ts +0 -6
- package/Components/Custom/LibPixiAreaClick.js +0 -16
- package/Components/Custom/LibPixiArrangeLinearV2.d.ts +0 -25
- package/Components/Custom/LibPixiArrangeLinearV2.js +0 -80
- package/Components/Custom/LibPixiButtonHover.d.ts +0 -40
- package/Components/Custom/LibPixiButtonHover.js +0 -53
- package/Components/Custom/LibPixiCapsule.d.ts +0 -5
- package/Components/Custom/LibPixiCapsule.js +0 -10
- package/Components/Custom/LibPixiCloseBtn.d.ts +0 -14
- package/Components/Custom/LibPixiCloseBtn.js +0 -36
- package/Components/Custom/LibPixiDragLocate.d.ts +0 -36
- package/Components/Custom/LibPixiDragLocate.js +0 -230
- package/Components/Custom/LibPixiDrawer.d.ts +0 -16
- package/Components/Custom/LibPixiDrawer.js +0 -59
- package/Components/Custom/LibPixiGridLayoutV2.d.ts +0 -27
- package/Components/Custom/LibPixiGridLayoutV2.js +0 -37
- package/Components/Custom/LibPixiHeadingParagraphLayout.d.ts +0 -18
- package/Components/Custom/LibPixiHeadingParagraphLayout.js +0 -27
- package/Components/Custom/LibPixiInput.d.ts +0 -77
- package/Components/Custom/LibPixiInput.js +0 -198
- package/Components/Custom/LibPixiLabelValue.d.ts +0 -30
- package/Components/Custom/LibPixiLabelValue.js +0 -26
- package/Components/Custom/LibPixiPerforMon.d.ts +0 -47
- package/Components/Custom/LibPixiPerforMon.js +0 -166
- package/Components/Custom/LibPixiProgress.d.ts +0 -33
- package/Components/Custom/LibPixiProgress.js +0 -47
- package/Components/Custom/LibPixiPuzzleBg.d.ts +0 -7
- package/Components/Custom/LibPixiPuzzleBg.js +0 -46
- package/Components/Custom/LibPixiScrollContainerX.d.ts +0 -71
- package/Components/Custom/LibPixiScrollContainerX.js +0 -198
- package/Components/Custom/LibPixiScrollContainerY.d.ts +0 -109
- package/Components/Custom/LibPixiScrollContainerY.js +0 -340
- package/Components/Custom/LibPixiScrollNum.d.ts +0 -67
- package/Components/Custom/LibPixiScrollNum.js +0 -184
- package/Components/Custom/LibPixiSlide.d.ts +0 -94
- package/Components/Custom/LibPixiSlide.js +0 -285
- package/Components/Custom/LibPixiSlider.d.ts +0 -82
- package/Components/Custom/LibPixiSlider.js +0 -165
- package/Components/Custom/LibPixiTable.d.ts +0 -64
- package/Components/Custom/LibPixiTable.js +0 -76
- package/Components/Custom/LibPixiTextGroupWrap.d.ts +0 -20
- package/Components/Custom/LibPixiTextGroupWrap.js +0 -50
- package/Components/Custom/LibPixiTriangle.d.ts +0 -5
- package/Components/Custom/LibPixiTriangle.js +0 -12
- package/Components/Custom/LibPixiTurntable.d.ts +0 -6
- package/Components/Custom/LibPixiTurntable.js +0 -14
- package/Utils/LibContainerCenter.d.ts +0 -3
- package/Utils/LibContainerCenter.js +0 -10
- package/Utils/LibControlledDelayedCall.d.ts +0 -5
- package/Utils/LibControlledDelayedCall.js +0 -20
- package/Utils/LibPixiArrangeLinear.d.ts +0 -16
- package/Utils/LibPixiArrangeLinear.js +0 -62
- package/Utils/LibPixiAudio.d.ts +0 -53
- package/Utils/LibPixiAudio.js +0 -168
- package/Utils/LibPixiCreateNineGrid.d.ts +0 -15
- package/Utils/LibPixiCreateNineGrid.js +0 -19
- package/Utils/LibPixiDialogManager/index.d.ts +0 -25
- package/Utils/LibPixiDialogManager/index.js +0 -43
- package/Utils/LibPixiDialogManager/ui/LibPixiBaseContainer.d.ts +0 -11
- package/Utils/LibPixiDialogManager/ui/LibPixiBaseContainer.js +0 -31
- package/Utils/LibPixiDialogManager/ui/LibPixiDialog.d.ts +0 -40
- package/Utils/LibPixiDialogManager/ui/LibPixiDialog.js +0 -143
- package/Utils/LibPixiDigitalIncreasingAnimation.d.ts +0 -18
- package/Utils/LibPixiDigitalIncreasingAnimation.js +0 -26
- package/Utils/LibPixiDownScaleAnimation.d.ts +0 -7
- package/Utils/LibPixiDownScaleAnimation.js +0 -33
- package/Utils/LibPixiEmitContainerEvent.d.ts +0 -7
- package/Utils/LibPixiEmitContainerEvent.js +0 -13
- package/Utils/LibPixiEvent.d.ts +0 -19
- package/Utils/LibPixiEvent.js +0 -68
- package/Utils/LibPixiFilter.d.ts +0 -9
- package/Utils/LibPixiFilter.js +0 -34
- package/Utils/LibPixiGlobalUpdater.d.ts +0 -15
- package/Utils/LibPixiGlobalUpdater.js +0 -21
- package/Utils/LibPixiGridLayout.d.ts +0 -10
- package/Utils/LibPixiGridLayout.js +0 -27
- package/Utils/LibPixiHVCenter.d.ts +0 -7
- package/Utils/LibPixiHVCenter.js +0 -14
- package/Utils/LibPixiHVGap.d.ts +0 -8
- package/Utils/LibPixiHVGap.js +0 -26
- package/Utils/LibPixiIntervalTrigger.d.ts +0 -7
- package/Utils/LibPixiIntervalTrigger.js +0 -35
- package/Utils/LibPixiOutsideClick.d.ts +0 -8
- package/Utils/LibPixiOutsideClick.js +0 -22
- package/Utils/LibPixiOverflowHidden.d.ts +0 -6
- package/Utils/LibPixiOverflowHidden.js +0 -14
- package/Utils/LibPixiPolygonDrawTool.d.ts +0 -44
- package/Utils/LibPixiPolygonDrawTool.js +0 -114
- package/Utils/LibPixiPromiseTickerTimeout.d.ts +0 -6
- package/Utils/LibPixiPromiseTickerTimeout.js +0 -22
- package/Utils/LibPixiScaleContainer.d.ts +0 -8
- package/Utils/LibPixiScaleContainer.js +0 -14
- package/Utils/LibPixiShadow.d.ts +0 -17
- package/Utils/LibPixiShadow.js +0 -18
- package/Utils/LibPixiSlideInput.d.ts +0 -55
- package/Utils/LibPixiSlideInput.js +0 -61
- package/Utils/LibPixiTicker.d.ts +0 -14
- package/Utils/LibPixiTicker.js +0 -49
- package/Utils/LibPixiTickerTimeout.d.ts +0 -6
- package/Utils/LibPixiTickerTimeout.js +0 -22
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { Container, Ticker } from "pixi.js";
|
|
2
|
-
import gsap from "gsap";
|
|
3
|
-
import { libPixiFilter } from "../../Utils/LibPixiFilter";
|
|
4
|
-
import { libJsCopy } from "lyb-js/Browser/LibJsCopy.js";
|
|
5
|
-
/** @description 元素拖拽定位 */
|
|
6
|
-
export class LibPixiDragLocate extends Container {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
/** 当前坐标值 */
|
|
10
|
-
this._positionValue = "";
|
|
11
|
-
/** 是否处于定位状态 */
|
|
12
|
-
this._isLocalte = false;
|
|
13
|
-
/** 是否显示输入框 */
|
|
14
|
-
this._showInput = false;
|
|
15
|
-
/** 是否允许移动 */
|
|
16
|
-
this._allowMove = false;
|
|
17
|
-
/** 按下坐标 */
|
|
18
|
-
this._downPos = { x: 0, y: 0 };
|
|
19
|
-
window.addEventListener("keydown", (e) => {
|
|
20
|
-
if (e.ctrlKey && e.key.toLowerCase() === "q" && e.shiftKey) {
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
if (this._isLocalte)
|
|
23
|
-
return;
|
|
24
|
-
this._showInput = !this._showInput;
|
|
25
|
-
}
|
|
26
|
-
if (e.key === "Escape") {
|
|
27
|
-
this._showInput = false;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
this._createInput();
|
|
31
|
-
this._createResultList();
|
|
32
|
-
this._createStatusBar();
|
|
33
|
-
LibPixiDragLocate.stage.on("pointerdown", (event) => {
|
|
34
|
-
if (!this._currentMoveContainer)
|
|
35
|
-
return;
|
|
36
|
-
this._allowMove = true;
|
|
37
|
-
const { x, y } = LibPixiDragLocate.stage.toLocal(event.global);
|
|
38
|
-
this._downPos = { x, y };
|
|
39
|
-
});
|
|
40
|
-
LibPixiDragLocate.stage.on("pointermove", (event) => {
|
|
41
|
-
if (!this._allowMove || !this._currentMoveContainer)
|
|
42
|
-
return;
|
|
43
|
-
const { x, y } = LibPixiDragLocate.stage.toLocal(event.global);
|
|
44
|
-
const dx = x - this._downPos.x;
|
|
45
|
-
const dy = y - this._downPos.y;
|
|
46
|
-
this._currentMoveContainer.x += dx;
|
|
47
|
-
this._currentMoveContainer.y += dy;
|
|
48
|
-
this._downPos = { x, y };
|
|
49
|
-
const posX = Math.round(this._currentMoveContainer.x);
|
|
50
|
-
const posY = Math.round(this._currentMoveContainer.y);
|
|
51
|
-
this._positionEl.textContent = `X: ${posX}, Y: ${posY}`;
|
|
52
|
-
this._positionValue = `xxx.position.set(${posX}, ${posY})`;
|
|
53
|
-
});
|
|
54
|
-
LibPixiDragLocate.stage.on("pointerup", () => {
|
|
55
|
-
this._allowMove = false;
|
|
56
|
-
}, this);
|
|
57
|
-
Ticker.shared.add(() => {
|
|
58
|
-
if (this._showInput) {
|
|
59
|
-
if (this._isLocalte) {
|
|
60
|
-
this._inputEl.style.display = "none";
|
|
61
|
-
this._resultEl.style.display = "none";
|
|
62
|
-
this._statusBarEl.style.display = "flex";
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
this._inputEl.style.display = "block";
|
|
66
|
-
this._resultEl.style.display = "flex";
|
|
67
|
-
this._statusBarEl.style.display = "none";
|
|
68
|
-
this._inputEl.focus();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
this._inputEl.style.display = "none";
|
|
73
|
-
this._resultEl.style.display = "none";
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
/** @description 创建输入框 */
|
|
78
|
-
_createInput() {
|
|
79
|
-
this._inputEl = document.createElement("input");
|
|
80
|
-
this._inputEl.type = "text";
|
|
81
|
-
this._inputEl.style.cssText = `
|
|
82
|
-
background-color: rgba(0,0,0,0.75);
|
|
83
|
-
border: 2px solid rgba(255,255,255,0.5);
|
|
84
|
-
color: #fff;
|
|
85
|
-
display: none;
|
|
86
|
-
font-size: 25px;
|
|
87
|
-
height: 50px;
|
|
88
|
-
left: 50%;
|
|
89
|
-
outline: none;
|
|
90
|
-
position: fixed;
|
|
91
|
-
text-align: center;
|
|
92
|
-
top: 25%;
|
|
93
|
-
transform: translate(-50%, -50%);
|
|
94
|
-
width: 50vw;
|
|
95
|
-
`;
|
|
96
|
-
document.body.appendChild(this._inputEl);
|
|
97
|
-
this._inputEl.addEventListener("input", () => {
|
|
98
|
-
const results = this._findByName(LibPixiDragLocate.stage, this._inputEl.value);
|
|
99
|
-
//创建搜索结果列表
|
|
100
|
-
this._resultEl.innerHTML = "";
|
|
101
|
-
const renderNode = (item) => {
|
|
102
|
-
const resultEl = this._createResultEl(item.node.constructor.name, item.node.name, item.depth);
|
|
103
|
-
this._resultEl.appendChild(resultEl);
|
|
104
|
-
gsap.killTweensOf(item.node);
|
|
105
|
-
//悬浮结果列表元素闪烁
|
|
106
|
-
resultEl.addEventListener("mouseenter", () => {
|
|
107
|
-
gsap.to(item.node, {
|
|
108
|
-
alpha: 0,
|
|
109
|
-
duration: 0.25,
|
|
110
|
-
yoyo: true,
|
|
111
|
-
ease: "none",
|
|
112
|
-
repeat: -1,
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
//离开结果后停止闪烁
|
|
116
|
-
resultEl.addEventListener("mouseleave", () => {
|
|
117
|
-
gsap.killTweensOf(item.node);
|
|
118
|
-
item.node.alpha = 1;
|
|
119
|
-
});
|
|
120
|
-
resultEl.addEventListener("click", () => {
|
|
121
|
-
gsap.killTweensOf(item.node);
|
|
122
|
-
this._currentMoveContainer = item.node;
|
|
123
|
-
item.node.alpha = 1;
|
|
124
|
-
item.node.filters = [libPixiFilter("desaturate", 0)];
|
|
125
|
-
this._isLocalte = true;
|
|
126
|
-
});
|
|
127
|
-
item.children.forEach(renderNode);
|
|
128
|
-
};
|
|
129
|
-
results.forEach(renderNode);
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
/** @description 创建用于展示搜索结果的列表 */
|
|
133
|
-
_createResultList() {
|
|
134
|
-
this._resultEl = document.createElement("div");
|
|
135
|
-
this._resultEl.style.cssText = `
|
|
136
|
-
background-color: rgba(0,0,0,0.75);
|
|
137
|
-
border: 2px solid rgba(255,255,255,0.5);
|
|
138
|
-
left: 50%;
|
|
139
|
-
transform: translateX(-50%);
|
|
140
|
-
height: 300px;
|
|
141
|
-
overflow-y: auto;
|
|
142
|
-
position: fixed;
|
|
143
|
-
display: none;
|
|
144
|
-
gap: 10px;
|
|
145
|
-
flex-direction: column;
|
|
146
|
-
top: calc(25% + 50px);
|
|
147
|
-
width: 50vw;
|
|
148
|
-
`;
|
|
149
|
-
document.body.appendChild(this._resultEl);
|
|
150
|
-
}
|
|
151
|
-
/** @description 创建搜索结果元素 */
|
|
152
|
-
_createResultEl(className, tagName, depth) {
|
|
153
|
-
const resultItem = document.createElement("div");
|
|
154
|
-
resultItem.style.cssText = `
|
|
155
|
-
display: flex;
|
|
156
|
-
justify-content: space-between;
|
|
157
|
-
padding: 5px 10px;
|
|
158
|
-
align-items: center;
|
|
159
|
-
width: 100%;
|
|
160
|
-
font-size: 25px;
|
|
161
|
-
background-color: rgba(255,255,255,0.1);
|
|
162
|
-
color: #fff;
|
|
163
|
-
padding-left: ${depth * 20}px;
|
|
164
|
-
`;
|
|
165
|
-
const classNameEl = document.createElement("div");
|
|
166
|
-
classNameEl.textContent = className;
|
|
167
|
-
resultItem.appendChild(classNameEl);
|
|
168
|
-
const tagNameEl = document.createElement("div");
|
|
169
|
-
tagNameEl.textContent = tagName;
|
|
170
|
-
resultItem.appendChild(tagNameEl);
|
|
171
|
-
return resultItem;
|
|
172
|
-
}
|
|
173
|
-
/** @description 创建状态栏 */
|
|
174
|
-
_createStatusBar() {
|
|
175
|
-
this._statusBarEl = document.createElement("div");
|
|
176
|
-
this._statusBarEl.style.cssText = `
|
|
177
|
-
align-items: center;
|
|
178
|
-
background-color: rgba(0,0,0,0.75);
|
|
179
|
-
border: 2px solid rgba(0, 255, 13, 0.5);
|
|
180
|
-
color: #fff;
|
|
181
|
-
display: none;
|
|
182
|
-
font-size: 25px;
|
|
183
|
-
justify-content: center;
|
|
184
|
-
position: fixed;
|
|
185
|
-
top: 25%;
|
|
186
|
-
height: 50px;
|
|
187
|
-
left: 50%;
|
|
188
|
-
transform: translate(-50%, -50%);
|
|
189
|
-
width: 50vw;
|
|
190
|
-
`;
|
|
191
|
-
this._positionEl = document.createElement("div");
|
|
192
|
-
this._statusBarEl.appendChild(this._positionEl);
|
|
193
|
-
document.body.appendChild(this._statusBarEl);
|
|
194
|
-
this._statusBarEl.addEventListener("click", () => {
|
|
195
|
-
this._isLocalte = false;
|
|
196
|
-
libJsCopy(this._positionValue);
|
|
197
|
-
if (this._currentMoveContainer) {
|
|
198
|
-
this._currentMoveContainer.filters = [];
|
|
199
|
-
this._currentMoveContainer = undefined;
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
/** @description 递归搜索 */
|
|
204
|
-
_findByName(root, keyword) {
|
|
205
|
-
if (!keyword)
|
|
206
|
-
return [];
|
|
207
|
-
const match = (node) => {
|
|
208
|
-
var _a;
|
|
209
|
-
return ((_a = node.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(keyword.toLowerCase())) ||
|
|
210
|
-
node.constructor.name.toLowerCase().includes(keyword.toLowerCase());
|
|
211
|
-
};
|
|
212
|
-
const dfs = (node, depth) => {
|
|
213
|
-
const children = node.children
|
|
214
|
-
.filter((c) => c instanceof Container)
|
|
215
|
-
.flatMap((c) => dfs(c, depth + 1));
|
|
216
|
-
if (match(node) || children.length > 0) {
|
|
217
|
-
return [
|
|
218
|
-
{
|
|
219
|
-
node,
|
|
220
|
-
depth,
|
|
221
|
-
children,
|
|
222
|
-
expanded: true,
|
|
223
|
-
},
|
|
224
|
-
];
|
|
225
|
-
}
|
|
226
|
-
return [];
|
|
227
|
-
};
|
|
228
|
-
return dfs(root, 0);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Container } from "pixi.js";
|
|
2
|
-
/** @description 底部弹出抽屉
|
|
3
|
-
* @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiDrawer-抽屉
|
|
4
|
-
*/
|
|
5
|
-
export declare class LibPixiDrawer extends Container {
|
|
6
|
-
/** 蒙版UI */
|
|
7
|
-
private _maskUI;
|
|
8
|
-
/** 抽屉容器 */
|
|
9
|
-
private _drawerContainer;
|
|
10
|
-
/**
|
|
11
|
-
* @param content 抽屉内容
|
|
12
|
-
*/
|
|
13
|
-
constructor(content: Container);
|
|
14
|
-
/** @description 关闭 */
|
|
15
|
-
close(): Promise<void>;
|
|
16
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { Container } from "pixi.js";
|
|
11
|
-
import gsap from "gsap";
|
|
12
|
-
import { LibPixiRectBgColor } from '../Base/LibPixiRectBgColor';
|
|
13
|
-
/** @description 底部弹出抽屉
|
|
14
|
-
* @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiDrawer-抽屉
|
|
15
|
-
*/
|
|
16
|
-
export class LibPixiDrawer extends Container {
|
|
17
|
-
/**
|
|
18
|
-
* @param content 抽屉内容
|
|
19
|
-
*/
|
|
20
|
-
constructor(content) {
|
|
21
|
-
super();
|
|
22
|
-
//蒙版
|
|
23
|
-
this._maskUI = new LibPixiRectBgColor({
|
|
24
|
-
bgColor: "#000",
|
|
25
|
-
width: 1080,
|
|
26
|
-
height: 1920,
|
|
27
|
-
});
|
|
28
|
-
this.addChild(this._maskUI);
|
|
29
|
-
this._maskUI.alpha = 0;
|
|
30
|
-
this._maskUI.eventMode = "static";
|
|
31
|
-
//弹窗内容容器
|
|
32
|
-
this._drawerContainer = content;
|
|
33
|
-
this.addChild(this._drawerContainer);
|
|
34
|
-
this._drawerContainer.y = this._maskUI.height;
|
|
35
|
-
gsap.to(this._maskUI, {
|
|
36
|
-
duration: 0.25,
|
|
37
|
-
alpha: 0.5,
|
|
38
|
-
});
|
|
39
|
-
gsap.to(this._drawerContainer, {
|
|
40
|
-
duration: 0.25,
|
|
41
|
-
ease: "power1.out",
|
|
42
|
-
y: this._maskUI.height - this._drawerContainer.height,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
/** @description 关闭 */
|
|
46
|
-
close() {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
gsap.to(this._drawerContainer, {
|
|
49
|
-
duration: 0.25,
|
|
50
|
-
y: this._maskUI.height,
|
|
51
|
-
});
|
|
52
|
-
yield gsap.to(this._maskUI, {
|
|
53
|
-
duration: 0.25,
|
|
54
|
-
delay: 0.125,
|
|
55
|
-
alpha: 0,
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface GridLayoutParams {
|
|
2
|
-
/** 列数 */
|
|
3
|
-
colNum?: number;
|
|
4
|
-
/** 列间隔 */
|
|
5
|
-
colGap?: number;
|
|
6
|
-
/** 行间隔 */
|
|
7
|
-
rowGap?: number;
|
|
8
|
-
/** 元素列表 */
|
|
9
|
-
elementList?: any[];
|
|
10
|
-
}
|
|
11
|
-
import { Container } from "pixi.js";
|
|
12
|
-
/** @description 网格布局 */
|
|
13
|
-
export declare class LibPixiGridLayoutV2<T extends Container> extends Container {
|
|
14
|
-
/** 参数 */
|
|
15
|
-
private _params;
|
|
16
|
-
/** 元素列表 */
|
|
17
|
-
private _elementList;
|
|
18
|
-
constructor(params?: GridLayoutParams);
|
|
19
|
-
/** @description 追加元素 */
|
|
20
|
-
push(element: T): void;
|
|
21
|
-
/** @description 布局 */
|
|
22
|
-
layout(): void;
|
|
23
|
-
/** @description 获取列表元素 */
|
|
24
|
-
getList(): T[];
|
|
25
|
-
/** @description 销毁列表元素 */
|
|
26
|
-
destroyList(): void;
|
|
27
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Container } from "pixi.js";
|
|
2
|
-
/** @description 网格布局 */
|
|
3
|
-
export class LibPixiGridLayoutV2 extends Container {
|
|
4
|
-
constructor(params) {
|
|
5
|
-
super();
|
|
6
|
-
/** 元素列表 */
|
|
7
|
-
this._elementList = [];
|
|
8
|
-
this._params = params || {};
|
|
9
|
-
this._elementList = this._params.elementList || [];
|
|
10
|
-
}
|
|
11
|
-
/** @description 追加元素 */
|
|
12
|
-
push(element) {
|
|
13
|
-
this.addChild(element);
|
|
14
|
-
this._elementList.push(element);
|
|
15
|
-
}
|
|
16
|
-
/** @description 布局 */
|
|
17
|
-
layout() {
|
|
18
|
-
const { colNum = this._elementList.length, colGap = 325, rowGap = 75, } = this._params;
|
|
19
|
-
this._elementList.forEach((item, index) => {
|
|
20
|
-
const col = index % colNum;
|
|
21
|
-
const row = Math.floor(index / colNum);
|
|
22
|
-
item.x = col * colGap;
|
|
23
|
-
item.y = row * rowGap;
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
/** @description 获取列表元素 */
|
|
27
|
-
getList() {
|
|
28
|
-
return this._elementList;
|
|
29
|
-
}
|
|
30
|
-
/** @description 销毁列表元素 */
|
|
31
|
-
destroyList() {
|
|
32
|
-
this._elementList.forEach((item) => {
|
|
33
|
-
item.destroy();
|
|
34
|
-
});
|
|
35
|
-
this._elementList = [];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Container } from "pixi.js";
|
|
2
|
-
import { LibPixiContainer } from "../Base/LibPixiContainer";
|
|
3
|
-
interface Params {
|
|
4
|
-
/** 宽度 */
|
|
5
|
-
width: number;
|
|
6
|
-
/** 高度 */
|
|
7
|
-
height: number;
|
|
8
|
-
/** 字体与高度比 */
|
|
9
|
-
fontSizeRatio: number;
|
|
10
|
-
/** 使用字体 */
|
|
11
|
-
fontFamily?: string;
|
|
12
|
-
/** 是否加粗 */
|
|
13
|
-
bold?: boolean;
|
|
14
|
-
/** 是否需要placeholder */
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
/** placeholder颜色 */
|
|
17
|
-
placeholderColor?: string;
|
|
18
|
-
/** 背景色,用于调试输入框的位置 */
|
|
19
|
-
bgColor?: string;
|
|
20
|
-
/** 输入类型 */
|
|
21
|
-
type?: "number" | "text" | "password";
|
|
22
|
-
/** 字体颜色 */
|
|
23
|
-
color?: string;
|
|
24
|
-
/** 初始值 */
|
|
25
|
-
value?: string;
|
|
26
|
-
/** 是否整数 */
|
|
27
|
-
integer?: boolean;
|
|
28
|
-
/** 是否允许输入负数 */
|
|
29
|
-
isNegative?: boolean;
|
|
30
|
-
/** 最小值 */
|
|
31
|
-
min?: number;
|
|
32
|
-
/** 最大值 */
|
|
33
|
-
max?: number;
|
|
34
|
-
/** 最大长度 */
|
|
35
|
-
maxLength?: number;
|
|
36
|
-
/** 对齐方式 */
|
|
37
|
-
align?: "left" | "center";
|
|
38
|
-
/** 输入回调 */
|
|
39
|
-
onInput?: (text: number | string) => void;
|
|
40
|
-
/** 失去焦点回调 */
|
|
41
|
-
onValue?: (text: number | string) => void;
|
|
42
|
-
/** 格式化显示值 */
|
|
43
|
-
onFormatValue?: (text: number | string) => string;
|
|
44
|
-
}
|
|
45
|
-
/** @description 动态缩放移动输入框 */
|
|
46
|
-
export declare class LibPixiInput extends LibPixiContainer {
|
|
47
|
-
/** 舞台 */
|
|
48
|
-
static stage: Container;
|
|
49
|
-
/** 参数 */
|
|
50
|
-
private _params;
|
|
51
|
-
/** 只读输入框 */
|
|
52
|
-
private _readonlyInput;
|
|
53
|
-
/** placeholder */
|
|
54
|
-
private _placeholder;
|
|
55
|
-
/** 输入框dom */
|
|
56
|
-
private _input;
|
|
57
|
-
/** 当前输入的值 */
|
|
58
|
-
private _value;
|
|
59
|
-
constructor(params: Params);
|
|
60
|
-
/** @description 设置值 */
|
|
61
|
-
setValue(v: string): void;
|
|
62
|
-
/** @description 创建输入框 */
|
|
63
|
-
private _createInput;
|
|
64
|
-
/** @description 创建只读输入框 */
|
|
65
|
-
private _createReadOnlyInput;
|
|
66
|
-
/** @description 聚焦 */
|
|
67
|
-
private _focus;
|
|
68
|
-
/** @description 失焦 */
|
|
69
|
-
private _blur;
|
|
70
|
-
/** @description 失去焦点处理 */
|
|
71
|
-
private _onBlurHandler;
|
|
72
|
-
/** @description 实时更新输入框位置 */
|
|
73
|
-
private _updateInputPosition;
|
|
74
|
-
/** @description 设置输入框类型 */
|
|
75
|
-
toggleType(type: "text" | "password"): void;
|
|
76
|
-
}
|
|
77
|
-
export {};
|