lyb-pixi-js 1.11.21 → 1.11.23
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.
|
@@ -28,15 +28,7 @@ export class LibPixiPerforMon extends Container {
|
|
|
28
28
|
this.pivot.x = this._containerWidth / 2;
|
|
29
29
|
this._resize(window.innerWidth, window.innerHeight);
|
|
30
30
|
window.addEventListener("resize", () => {
|
|
31
|
-
|
|
32
|
-
this.x = 1920 / 2;
|
|
33
|
-
}
|
|
34
|
-
else if (LibPixiPerforMon.ADAPT_MODE === "v") {
|
|
35
|
-
this.x = 1080 / 2;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this._resize(window.innerWidth, window.innerHeight);
|
|
39
|
-
}
|
|
31
|
+
this._resize(window.innerWidth, window.innerHeight);
|
|
40
32
|
});
|
|
41
33
|
//创建背景
|
|
42
34
|
this._bg = new LibPixiRectBgColor({
|
|
@@ -133,12 +125,20 @@ export class LibPixiPerforMon extends Container {
|
|
|
133
125
|
return color;
|
|
134
126
|
}
|
|
135
127
|
_resize(w, h) {
|
|
136
|
-
if (
|
|
128
|
+
if (LibPixiPerforMon.ADAPT_MODE === "h") {
|
|
137
129
|
this.x = 1920 / 2;
|
|
138
130
|
}
|
|
139
|
-
else {
|
|
131
|
+
else if (LibPixiPerforMon.ADAPT_MODE === "v") {
|
|
140
132
|
this.x = 1080 / 2;
|
|
141
133
|
}
|
|
134
|
+
else {
|
|
135
|
+
if (w > h) {
|
|
136
|
+
this.x = 1920 / 2;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
this.x = 1080 / 2;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
/** 当前适配模式 */
|
|
@@ -7,12 +7,12 @@ import { Ticker } from "pixi.js";
|
|
|
7
7
|
export const libPixiPromiseTickerTimeout = (delay = 1, callback) => {
|
|
8
8
|
return new Promise((resolve) => {
|
|
9
9
|
let elapsedTime = 0;
|
|
10
|
-
const ticker =
|
|
10
|
+
const ticker = Ticker.shared;
|
|
11
11
|
const tickerCallback = () => {
|
|
12
12
|
elapsedTime += ticker.deltaMS;
|
|
13
13
|
if (elapsedTime >= delay) {
|
|
14
14
|
callback === null || callback === void 0 ? void 0 : callback();
|
|
15
|
-
ticker.
|
|
15
|
+
ticker.remove(tickerCallback);
|
|
16
16
|
resolve();
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -6,23 +6,17 @@ import { Ticker } from "pixi.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export const libPixiTickerTimeout = (callback, delay = 1) => {
|
|
8
8
|
let elapsedTime = 0;
|
|
9
|
-
const ticker =
|
|
9
|
+
const ticker = Ticker.shared;
|
|
10
10
|
const tickerCallback = () => {
|
|
11
11
|
elapsedTime += ticker.deltaMS;
|
|
12
12
|
if (elapsedTime >= delay) {
|
|
13
13
|
callback === null || callback === void 0 ? void 0 : callback();
|
|
14
|
-
|
|
15
|
-
ticker.destroy();
|
|
16
|
-
}
|
|
17
|
-
catch (error) { }
|
|
14
|
+
ticker.remove(tickerCallback);
|
|
18
15
|
}
|
|
19
16
|
};
|
|
20
17
|
ticker.add(tickerCallback);
|
|
21
18
|
ticker.start();
|
|
22
19
|
return () => {
|
|
23
|
-
|
|
24
|
-
ticker.destroy();
|
|
25
|
-
}
|
|
26
|
-
catch (error) { }
|
|
20
|
+
ticker.remove(tickerCallback);
|
|
27
21
|
};
|
|
28
22
|
};
|
package/lyb-pixi.js
CHANGED
|
@@ -48946,13 +48946,7 @@ void main(void)\r
|
|
|
48946
48946
|
this.pivot.x = this._containerWidth / 2;
|
|
48947
48947
|
this._resize(window.innerWidth, window.innerHeight);
|
|
48948
48948
|
window.addEventListener("resize", () => {
|
|
48949
|
-
|
|
48950
|
-
this.x = 1920 / 2;
|
|
48951
|
-
} else if (_LibPixiPerforMon2.ADAPT_MODE === "v") {
|
|
48952
|
-
this.x = 1080 / 2;
|
|
48953
|
-
} else {
|
|
48954
|
-
this._resize(window.innerWidth, window.innerHeight);
|
|
48955
|
-
}
|
|
48949
|
+
this._resize(window.innerWidth, window.innerHeight);
|
|
48956
48950
|
});
|
|
48957
48951
|
this._bg = new LibPixiRectBgColor({
|
|
48958
48952
|
width: this._containerWidth,
|
|
@@ -49042,10 +49036,16 @@ void main(void)\r
|
|
|
49042
49036
|
return color;
|
|
49043
49037
|
}
|
|
49044
49038
|
_resize(w2, h2) {
|
|
49045
|
-
if (
|
|
49039
|
+
if (_LibPixiPerforMon2.ADAPT_MODE === "h") {
|
|
49046
49040
|
this.x = 1920 / 2;
|
|
49047
|
-
} else {
|
|
49041
|
+
} else if (_LibPixiPerforMon2.ADAPT_MODE === "v") {
|
|
49048
49042
|
this.x = 1080 / 2;
|
|
49043
|
+
} else {
|
|
49044
|
+
if (w2 > h2) {
|
|
49045
|
+
this.x = 1920 / 2;
|
|
49046
|
+
} else {
|
|
49047
|
+
this.x = 1080 / 2;
|
|
49048
|
+
}
|
|
49049
49049
|
}
|
|
49050
49050
|
}
|
|
49051
49051
|
};
|
|
@@ -54511,12 +54511,12 @@ void main(void)\r
|
|
|
54511
54511
|
const libPixiPromiseTickerTimeout = (delay = 1, callback) => {
|
|
54512
54512
|
return new Promise((resolve) => {
|
|
54513
54513
|
let elapsedTime = 0;
|
|
54514
|
-
const ticker2 =
|
|
54514
|
+
const ticker2 = Ticker.shared;
|
|
54515
54515
|
const tickerCallback = () => {
|
|
54516
54516
|
elapsedTime += ticker2.deltaMS;
|
|
54517
54517
|
if (elapsedTime >= delay) {
|
|
54518
54518
|
callback == null ? void 0 : callback();
|
|
54519
|
-
ticker2.
|
|
54519
|
+
ticker2.remove(tickerCallback);
|
|
54520
54520
|
resolve();
|
|
54521
54521
|
}
|
|
54522
54522
|
};
|
|
@@ -54807,24 +54807,18 @@ void main(void){
|
|
|
54807
54807
|
};
|
|
54808
54808
|
const libPixiTickerTimeout = (callback, delay = 1) => {
|
|
54809
54809
|
let elapsedTime = 0;
|
|
54810
|
-
const ticker2 =
|
|
54810
|
+
const ticker2 = Ticker.shared;
|
|
54811
54811
|
const tickerCallback = () => {
|
|
54812
54812
|
elapsedTime += ticker2.deltaMS;
|
|
54813
54813
|
if (elapsedTime >= delay) {
|
|
54814
54814
|
callback == null ? void 0 : callback();
|
|
54815
|
-
|
|
54816
|
-
ticker2.destroy();
|
|
54817
|
-
} catch (error) {
|
|
54818
|
-
}
|
|
54815
|
+
ticker2.remove(tickerCallback);
|
|
54819
54816
|
}
|
|
54820
54817
|
};
|
|
54821
54818
|
ticker2.add(tickerCallback);
|
|
54822
54819
|
ticker2.start();
|
|
54823
54820
|
return () => {
|
|
54824
|
-
|
|
54825
|
-
ticker2.destroy();
|
|
54826
|
-
} catch (error) {
|
|
54827
|
-
}
|
|
54821
|
+
ticker2.remove(tickerCallback);
|
|
54828
54822
|
};
|
|
54829
54823
|
};
|
|
54830
54824
|
class LibPixiSlideInput {
|