lyb-pixi-js 1.11.20 → 1.11.22

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.
@@ -3,6 +3,8 @@ import { type Application, Container } from "pixi.js";
3
3
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiPerforMon-性能监视器
4
4
  */
5
5
  export declare class LibPixiPerforMon extends Container {
6
+ /** 当前适配模式 */
7
+ static ADAPT_MODE: "h" | "v" | "hv";
6
8
  /** 数据收集时间间隔 (5秒) */
7
9
  private readonly COLLECT_TIME;
8
10
  /** 当前时间 */
@@ -125,14 +125,24 @@ export class LibPixiPerforMon extends Container {
125
125
  return color;
126
126
  }
127
127
  _resize(w, h) {
128
- if (w > h) {
128
+ if (LibPixiPerforMon.ADAPT_MODE === "h") {
129
129
  this.x = 1920 / 2;
130
130
  }
131
- else {
131
+ else if (LibPixiPerforMon.ADAPT_MODE === "v") {
132
132
  this.x = 1080 / 2;
133
133
  }
134
+ else {
135
+ if (w > h) {
136
+ this.x = 1920 / 2;
137
+ }
138
+ else {
139
+ this.x = 1080 / 2;
140
+ }
141
+ }
134
142
  }
135
143
  }
144
+ /** 当前适配模式 */
145
+ LibPixiPerforMon.ADAPT_MODE = "hv";
136
146
  class TextBox extends Container {
137
147
  constructor(text, fontSize = 26) {
138
148
  super();
package/lyb-pixi.js CHANGED
@@ -48955,7 +48955,7 @@ void main(void)\r
48955
48955
  });
48956
48956
  }
48957
48957
  }
48958
- class LibPixiPerforMon extends Container {
48958
+ const _LibPixiPerforMon = class _LibPixiPerforMon2 extends Container {
48959
48959
  constructor(app) {
48960
48960
  super();
48961
48961
  this.COLLECT_TIME = 5 * 1e3;
@@ -49060,13 +49060,21 @@ void main(void)\r
49060
49060
  return color;
49061
49061
  }
49062
49062
  _resize(w2, h2) {
49063
- if (w2 > h2) {
49063
+ if (_LibPixiPerforMon2.ADAPT_MODE === "h") {
49064
49064
  this.x = 1920 / 2;
49065
- } else {
49065
+ } else if (_LibPixiPerforMon2.ADAPT_MODE === "v") {
49066
49066
  this.x = 1080 / 2;
49067
+ } else {
49068
+ if (w2 > h2) {
49069
+ this.x = 1920 / 2;
49070
+ } else {
49071
+ this.x = 1080 / 2;
49072
+ }
49067
49073
  }
49068
49074
  }
49069
- }
49075
+ };
49076
+ _LibPixiPerforMon.ADAPT_MODE = "hv";
49077
+ let LibPixiPerforMon = _LibPixiPerforMon;
49070
49078
  class TextBox extends Container {
49071
49079
  constructor(text, fontSize = 26) {
49072
49080
  super();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.11.20",
3
+ "version": "1.11.22",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "exports": {