lyb-pixi-js 1.12.38 → 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 -138
- 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,55 +0,0 @@
|
|
|
1
|
-
import type { Application, Container } from "pixi.js";
|
|
2
|
-
export interface LibPixiSlideInputParams {
|
|
3
|
-
/** App */
|
|
4
|
-
app: Application;
|
|
5
|
-
/** 有效点击范围 */
|
|
6
|
-
clickArea: Container[];
|
|
7
|
-
/** 滑动区域 */
|
|
8
|
-
sideArea: Container;
|
|
9
|
-
/** 最大移动距离 */
|
|
10
|
-
maxMoveDistance: number;
|
|
11
|
-
/** 起点坐标 */
|
|
12
|
-
startX?: number;
|
|
13
|
-
/** 按下回调 */
|
|
14
|
-
onDown?: () => void;
|
|
15
|
-
/** 抬起回调 */
|
|
16
|
-
onUp?: () => void;
|
|
17
|
-
/** 拖动回调 */
|
|
18
|
-
onChange: (x: number, value: number) => void;
|
|
19
|
-
}
|
|
20
|
-
/** @description 滑动选择器核心代码
|
|
21
|
-
* @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiSlideInput-滑动选择值
|
|
22
|
-
*/
|
|
23
|
-
export declare class LibPixiSlideInput {
|
|
24
|
-
/** App */
|
|
25
|
-
private _app;
|
|
26
|
-
/** 滑动区域 */
|
|
27
|
-
private _sideArea;
|
|
28
|
-
/** 最大移动距离 */
|
|
29
|
-
private _maxMoveDistance;
|
|
30
|
-
/** 是否处于拖动中 */
|
|
31
|
-
private _isDragging;
|
|
32
|
-
/** 当前移动的位置 */
|
|
33
|
-
private _moveX;
|
|
34
|
-
/** 上次移动的位置 */
|
|
35
|
-
private _lastMoveX;
|
|
36
|
-
/** 当前进度 */
|
|
37
|
-
private _progress;
|
|
38
|
-
/** 按下回调 */
|
|
39
|
-
private _onDown?;
|
|
40
|
-
/** 抬起回调 */
|
|
41
|
-
private _onUp?;
|
|
42
|
-
/** 拖动回调 */
|
|
43
|
-
private _onChange;
|
|
44
|
-
constructor(params: LibPixiSlideInputParams);
|
|
45
|
-
/** @description 设置进度
|
|
46
|
-
* @param value 进度值,范围 0-1
|
|
47
|
-
*/
|
|
48
|
-
setValue(value: number): void;
|
|
49
|
-
/** @description 按下触发 */
|
|
50
|
-
private _onDragStart;
|
|
51
|
-
/** @description 移动触发 */
|
|
52
|
-
private _onDragMove;
|
|
53
|
-
/** @description 抬起触发 */
|
|
54
|
-
private _onDragEnd;
|
|
55
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { libPixiEvent } from "./LibPixiEvent";
|
|
2
|
-
/** @description 滑动选择器核心代码
|
|
3
|
-
* @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiSlideInput-滑动选择值
|
|
4
|
-
*/
|
|
5
|
-
export class LibPixiSlideInput {
|
|
6
|
-
constructor(params) {
|
|
7
|
-
/** 是否处于拖动中 */
|
|
8
|
-
this._isDragging = false;
|
|
9
|
-
/** 当前移动的位置 */
|
|
10
|
-
this._moveX = 0;
|
|
11
|
-
/** 上次移动的位置 */
|
|
12
|
-
this._lastMoveX = 0;
|
|
13
|
-
/** 当前进度 */
|
|
14
|
-
this._progress = 0;
|
|
15
|
-
const { app, clickArea, maxMoveDistance, onChange, onDown, onUp, sideArea, } = params;
|
|
16
|
-
this._app = app;
|
|
17
|
-
this._maxMoveDistance = maxMoveDistance;
|
|
18
|
-
this._onChange = onChange;
|
|
19
|
-
this._onDown = onDown;
|
|
20
|
-
this._onUp = onUp;
|
|
21
|
-
this._sideArea = sideArea;
|
|
22
|
-
clickArea.forEach((item) => {
|
|
23
|
-
libPixiEvent(item, "pointerdown", this._onDragStart.bind(this));
|
|
24
|
-
});
|
|
25
|
-
libPixiEvent(sideArea, "pointerdown", this._onDragMove.bind(this));
|
|
26
|
-
app.stage.on("pointermove", this._onDragMove.bind(this));
|
|
27
|
-
app.stage.on("pointerup", this._onDragEnd.bind(this));
|
|
28
|
-
}
|
|
29
|
-
/** @description 设置进度
|
|
30
|
-
* @param value 进度值,范围 0-1
|
|
31
|
-
*/
|
|
32
|
-
setValue(value) {
|
|
33
|
-
this._progress = value;
|
|
34
|
-
this._lastMoveX = this._maxMoveDistance * value;
|
|
35
|
-
this._onChange(this._lastMoveX, value);
|
|
36
|
-
}
|
|
37
|
-
/** @description 按下触发 */
|
|
38
|
-
_onDragStart() {
|
|
39
|
-
var _a;
|
|
40
|
-
this._app.stage.eventMode = "static";
|
|
41
|
-
this._isDragging = true;
|
|
42
|
-
(_a = this._onDown) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
43
|
-
}
|
|
44
|
-
/** @description 移动触发 */
|
|
45
|
-
_onDragMove(event) {
|
|
46
|
-
const position = event.getLocalPosition(this._sideArea);
|
|
47
|
-
if (this._isDragging) {
|
|
48
|
-
this._moveX = Math.max(0, Math.min(position.x, this._maxMoveDistance));
|
|
49
|
-
this._progress = Number((this._moveX / this._maxMoveDistance).toFixed(2));
|
|
50
|
-
this._onChange(this._moveX, this._progress);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/** @description 抬起触发 */
|
|
54
|
-
_onDragEnd() {
|
|
55
|
-
var _a;
|
|
56
|
-
this._app.stage.eventMode = "auto";
|
|
57
|
-
this._isDragging = false;
|
|
58
|
-
this._lastMoveX = this._moveX;
|
|
59
|
-
(_a = this._onUp) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
60
|
-
}
|
|
61
|
-
}
|
package/Utils/LibPixiTicker.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** @description Ticker管理器 */
|
|
2
|
-
export declare class LibPixiTicker {
|
|
3
|
-
private static _callbacks;
|
|
4
|
-
/** @description 添加回调,重复 ID 会覆盖 */
|
|
5
|
-
static add(id: string, fn: () => void): () => void;
|
|
6
|
-
/** @description 删除回调 */
|
|
7
|
-
static remove(id: string): void;
|
|
8
|
-
/** @description 停止某个回调(pause) */
|
|
9
|
-
static stop(id: string): void;
|
|
10
|
-
/** @description 启动某个回调(resume) */
|
|
11
|
-
static start(id: string): void;
|
|
12
|
-
/** @description 清空所有回调 */
|
|
13
|
-
static clearAll(): void;
|
|
14
|
-
}
|
package/Utils/LibPixiTicker.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Ticker } from "pixi.js";
|
|
2
|
-
/** @description Ticker管理器 */
|
|
3
|
-
export class LibPixiTicker {
|
|
4
|
-
/** @description 添加回调,重复 ID 会覆盖 */
|
|
5
|
-
static add(id, fn) {
|
|
6
|
-
// 如果已有相同 ID,先移除旧回调
|
|
7
|
-
if (this._callbacks.has(id)) {
|
|
8
|
-
Ticker.shared.remove(this._callbacks.get(id).fn);
|
|
9
|
-
}
|
|
10
|
-
// 默认 active
|
|
11
|
-
this._callbacks.set(id, { fn, active: true });
|
|
12
|
-
Ticker.shared.add(fn);
|
|
13
|
-
return () => {
|
|
14
|
-
LibPixiTicker.remove(id);
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
/** @description 删除回调 */
|
|
18
|
-
static remove(id) {
|
|
19
|
-
const cb = this._callbacks.get(id);
|
|
20
|
-
if (cb) {
|
|
21
|
-
Ticker.shared.remove(cb.fn);
|
|
22
|
-
this._callbacks.delete(id);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/** @description 停止某个回调(pause) */
|
|
26
|
-
static stop(id) {
|
|
27
|
-
const cb = this._callbacks.get(id);
|
|
28
|
-
if (cb && cb.active) {
|
|
29
|
-
Ticker.shared.remove(cb.fn);
|
|
30
|
-
cb.active = false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/** @description 启动某个回调(resume) */
|
|
34
|
-
static start(id) {
|
|
35
|
-
const cb = this._callbacks.get(id);
|
|
36
|
-
if (cb && !cb.active) {
|
|
37
|
-
Ticker.shared.add(cb.fn);
|
|
38
|
-
cb.active = true;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/** @description 清空所有回调 */
|
|
42
|
-
static clearAll() {
|
|
43
|
-
this._callbacks.forEach((cb) => {
|
|
44
|
-
Ticker.shared.remove(cb.fn);
|
|
45
|
-
});
|
|
46
|
-
this._callbacks.clear();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
LibPixiTicker._callbacks = new Map();
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** @description 基于 Ticker 的定时器
|
|
2
|
-
* @param callback 延迟后执行的函数
|
|
3
|
-
* @param delay 延迟时间
|
|
4
|
-
* @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiTickerTimeout-Ticker定时器
|
|
5
|
-
*/
|
|
6
|
-
export declare const libPixiTickerTimeout: (callback: () => void, delay?: number) => () => void;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Ticker } from "pixi.js";
|
|
2
|
-
/** @description 基于 Ticker 的定时器
|
|
3
|
-
* @param callback 延迟后执行的函数
|
|
4
|
-
* @param delay 延迟时间
|
|
5
|
-
* @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiTickerTimeout-Ticker定时器
|
|
6
|
-
*/
|
|
7
|
-
export const libPixiTickerTimeout = (callback, delay = 1) => {
|
|
8
|
-
let elapsedTime = 0;
|
|
9
|
-
const ticker = Ticker.shared;
|
|
10
|
-
const tickerCallback = () => {
|
|
11
|
-
elapsedTime += ticker.deltaMS;
|
|
12
|
-
if (elapsedTime >= delay) {
|
|
13
|
-
callback === null || callback === void 0 ? void 0 : callback();
|
|
14
|
-
ticker.remove(tickerCallback);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
ticker.add(tickerCallback);
|
|
18
|
-
ticker.start();
|
|
19
|
-
return () => {
|
|
20
|
-
ticker.remove(tickerCallback);
|
|
21
|
-
};
|
|
22
|
-
};
|