lyb-pixi-js 1.1.7 → 1.1.11

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.
Files changed (63) hide show
  1. package/README.md +76 -44
  2. package/package.json +6 -19
  3. package/dist/Components/Base/LibPixiBitText.d.ts +0 -20
  4. package/dist/Components/Base/LibPixiBitText.js +0 -26
  5. package/dist/Components/Base/LibPixiContainer.d.ts +0 -22
  6. package/dist/Components/Base/LibPixiContainer.js +0 -51
  7. package/dist/Components/Base/LibPixiParticleMove.d.ts +0 -39
  8. package/dist/Components/Base/LibPixiParticleMove.js +0 -100
  9. package/dist/Components/Base/LibPixiRectBgColor.d.ts +0 -45
  10. package/dist/Components/Base/LibPixiRectBgColor.js +0 -98
  11. package/dist/Components/Base/LibPixiSpine.d.ts +0 -57
  12. package/dist/Components/Base/LibPixiSpine.js +0 -122
  13. package/dist/Components/Base/LibPixiText.d.ts +0 -37
  14. package/dist/Components/Base/LibPixiText.js +0 -32
  15. package/dist/Components/Custom/LibPixiButtonHover.d.ts +0 -32
  16. package/dist/Components/Custom/LibPixiButtonHover.js +0 -44
  17. package/dist/Components/Custom/LibPixiCloseBtn.d.ts +0 -14
  18. package/dist/Components/Custom/LibPixiCloseBtn.js +0 -35
  19. package/dist/Components/Custom/LibPixiDrawer.d.ts +0 -16
  20. package/dist/Components/Custom/LibPixiDrawer.js +0 -59
  21. package/dist/Components/Custom/LibPixiPerforMon.d.ts +0 -31
  22. package/dist/Components/Custom/LibPixiPerforMon.js +0 -107
  23. package/dist/Components/Custom/LibPixiProgress.d.ts +0 -29
  24. package/dist/Components/Custom/LibPixiProgress.js +0 -36
  25. package/dist/Components/Custom/LibPixiScrollContainer.d.ts +0 -57
  26. package/dist/Components/Custom/LibPixiScrollContainer.js +0 -166
  27. package/dist/Components/Custom/LibPixiScrollNum.d.ts +0 -62
  28. package/dist/Components/Custom/LibPixiScrollNum.js +0 -146
  29. package/dist/Components/Custom/LibPixiSlider.d.ts +0 -45
  30. package/dist/Components/Custom/LibPixiSlider.js +0 -111
  31. package/dist/Components/Custom/LibPixiSubAddMinMax.d.ts +0 -49
  32. package/dist/Components/Custom/LibPixiSubAddMinMax.js +0 -75
  33. package/dist/Components/Custom/LibPixiTable.d.ts +0 -52
  34. package/dist/Components/Custom/LibPixiTable.js +0 -70
  35. package/dist/Utils/LibPixiAudio.d.ts +0 -34
  36. package/dist/Utils/LibPixiAudio.js +0 -140
  37. package/dist/Utils/LibPixiCreateNineGrid.d.ts +0 -15
  38. package/dist/Utils/LibPixiCreateNineGrid.js +0 -19
  39. package/dist/Utils/LibPixiEvent.d.ts +0 -9
  40. package/dist/Utils/LibPixiEvent.js +0 -22
  41. package/dist/Utils/LibPixiEventControlled.d.ts +0 -8
  42. package/dist/Utils/LibPixiEventControlled.js +0 -21
  43. package/dist/Utils/LibPixiFilter.d.ts +0 -9
  44. package/dist/Utils/LibPixiFilter.js +0 -30
  45. package/dist/Utils/LibPixiIntervalTrigger.d.ts +0 -6
  46. package/dist/Utils/LibPixiIntervalTrigger.js +0 -33
  47. package/dist/Utils/LibPixiOutsideClick.d.ts +0 -8
  48. package/dist/Utils/LibPixiOutsideClick.js +0 -22
  49. package/dist/Utils/LibPixiOverflowHidden.d.ts +0 -6
  50. package/dist/Utils/LibPixiOverflowHidden.js +0 -14
  51. package/dist/Utils/LibPixiPromiseTickerTimeout.d.ts +0 -6
  52. package/dist/Utils/LibPixiPromiseTickerTimeout.js +0 -22
  53. package/dist/Utils/LibPixiScaleContainer.d.ts +0 -8
  54. package/dist/Utils/LibPixiScaleContainer.js +0 -14
  55. package/dist/Utils/LibPixiShadow.d.ts +0 -17
  56. package/dist/Utils/LibPixiShadow.js +0 -18
  57. package/dist/Utils/LibPixiTickerTimeout.d.ts +0 -6
  58. package/dist/Utils/LibPixiTickerTimeout.js +0 -28
  59. package/dist/index.d.ts +0 -1
  60. package/dist/index.js +0 -2
  61. package/dist/libPixiJs.d.ts +0 -163
  62. package/dist/libPixiJs.js +0 -174
  63. package/umd/lyb-pixi.js +0 -1263
@@ -1,98 +0,0 @@
1
- import { Graphics } from "pixi.js";
2
- import gsap from "gsap";
3
- /** @description 自定义矩形背景色
4
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiRectBgColor-矩形
5
- */
6
- export class LibPixiRectBgColor extends Graphics {
7
- constructor(options) {
8
- super();
9
- /** 圆边大小 */
10
- this.radius = 0;
11
- /** 启用着色 */
12
- this.enableTint = true;
13
- /** 背景颜色 */
14
- this.bgColor = "#fff";
15
- /** 边框宽度 */
16
- this.borderWidth = 0;
17
- /** 边框颜色 */
18
- this.borderColor = "black";
19
- /** 背景色 */
20
- this.bgAlpha = 1;
21
- const { x = 0, y = 0, width = 0, height = 0, bgColor = "#fff", alpha = 1, radius = 0, borderWidth = 0, borderColor = "black", enableTint = true, } = options;
22
- this.x = x;
23
- this.y = y;
24
- this.bgAlpha = alpha;
25
- this.radius = radius;
26
- this.enableTint = enableTint;
27
- this.bgColor = bgColor;
28
- this.borderWidth = borderWidth;
29
- this.borderColor = borderColor;
30
- this.renderBg(width, height);
31
- }
32
- /** @description 重新绘制并添加颜色 */
33
- updateColor(tint) {
34
- gsap.to(this, { tint, duration: 0.25 });
35
- }
36
- /** @description 更新宽度 */
37
- renderBg(width, height) {
38
- this.clear();
39
- if (this.enableTint) {
40
- this.beginFill("#fff", this.bgAlpha);
41
- this.tint = this.bgColor;
42
- }
43
- else {
44
- this.beginFill(this.bgColor, this.bgAlpha);
45
- this.borderWidth && this.lineStyle(this.borderWidth, this.borderColor, 1);
46
- }
47
- this.borderWidth && this.lineStyle(this.borderWidth, this.borderColor, 1);
48
- if (this.radius !== 0) {
49
- if (typeof this.radius === "number") {
50
- this.drawRoundedRect(0, 0, width, height, this.radius);
51
- }
52
- else {
53
- // 绘制顶部边
54
- this.moveTo(0 + this.radius[0], 0);
55
- this.lineTo(0 + width - this.radius[1], 0);
56
- // 绘制右上角的圆角
57
- if (this.radius[1] > 0) {
58
- this.arcTo(0 + width, 0, 0 + width, 0 + this.radius[1], this.radius[1]);
59
- }
60
- else {
61
- this.lineTo(0 + width, 0);
62
- }
63
- // 绘制右侧边
64
- this.lineTo(0 + width, 0 + height - this.radius[2]);
65
- // 绘制右下角的圆角
66
- if (this.radius[2] > 0) {
67
- this.arcTo(0 + width, 0 + height, 0 + width - this.radius[2], 0 + height, this.radius[2]);
68
- }
69
- else {
70
- this.lineTo(0 + width, 0 + height);
71
- }
72
- // 绘制底部边
73
- this.lineTo(0 + this.radius[3], 0 + height);
74
- // 绘制左下角的圆角
75
- if (this.radius[3] > 0) {
76
- this.arcTo(0, 0 + height, 0, 0 + height - this.radius[3], this.radius[3]);
77
- }
78
- else {
79
- this.lineTo(0, 0 + height);
80
- }
81
- // 绘制左侧边
82
- this.lineTo(0, 0 + this.radius[0]);
83
- // 绘制左上角的圆角
84
- if (this.radius[0] > 0) {
85
- this.arcTo(0, 0, 0 + this.radius[0], 0, this.radius[0]);
86
- }
87
- else {
88
- this.lineTo(0, 0);
89
- }
90
- this.closePath();
91
- }
92
- }
93
- else {
94
- this.drawRect(0, 0, width, height);
95
- }
96
- this.endFill();
97
- }
98
- }
@@ -1,57 +0,0 @@
1
- import { type Container } from "pixi.js";
2
- import { Spine } from "@pixi-spine/runtime-3.8";
3
- export interface OnUpdateParams {
4
- x: number;
5
- y: number;
6
- rotate: number;
7
- scaleX: number;
8
- scaleY: number;
9
- }
10
- export interface LibPixiSpineParams {
11
- /** 默认是否可见 */
12
- visible?: boolean;
13
- /** 挂点列表 */
14
- followPointList?: {
15
- /** 挂点名称 */
16
- boneName: string;
17
- /** 跟随的精灵或容器 */
18
- follow: Container;
19
- /** 是否启用角度 */
20
- angleFollow?: boolean;
21
- /** 是否启用缩放 */
22
- scaleFollow?: boolean;
23
- /** 更新回调,不传则接受内置挂点更新 */
24
- onUpdate?: (config: OnUpdateParams) => void;
25
- }[];
26
- }
27
- /** @description 自定义 Spine 动画
28
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiSpine-动画
29
- */
30
- export declare class LibPixiSpine extends Spine {
31
- /** 挂点 */
32
- private _followDots;
33
- /** 是否已开始 */
34
- private _isStart;
35
- /** spine更新函数 */
36
- private _loopFn;
37
- constructor(spineNameOrTexture: string | any, params?: LibPixiSpineParams);
38
- /** @description 设置动画
39
- * @param animationName 动画名称
40
- * @param loop 是否循环播放
41
- */
42
- setAnimation(animationName?: string, loop?: boolean): Promise<void>;
43
- /** @description 添加动画
44
- * @param animationName 动画名称
45
- * @param loop 是否循环播放
46
- * @param delay 延迟播放时间
47
- */
48
- addAnimation(animationName?: string, loop?: boolean, delay?: number): Promise<void>;
49
- /** @description 改变骨骼数据 */
50
- setSkin(skinName: string): void;
51
- /** @description 销毁动画及挂点 */
52
- destroyAll(): void;
53
- /** @description 更新渲染 */
54
- private _loop;
55
- /** @description 更新挂点 */
56
- private _updateFollowPoint;
57
- }
@@ -1,122 +0,0 @@
1
- import { Assets, Ticker } from "pixi.js";
2
- import { Spine } from "@pixi-spine/runtime-3.8";
3
- import gsap from "gsap";
4
- /** @description 自定义 Spine 动画
5
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiSpine-动画
6
- */
7
- export class LibPixiSpine extends Spine {
8
- constructor(spineNameOrTexture, params) {
9
- const { followPointList, visible = false } = params || {};
10
- let spineData;
11
- if (typeof spineNameOrTexture === "string") {
12
- spineData = Assets.get(spineNameOrTexture).spineData;
13
- }
14
- else {
15
- spineData = spineNameOrTexture.spineData;
16
- }
17
- super(spineData);
18
- /** 挂点 */
19
- this._followDots = [];
20
- /** 是否已开始 */
21
- this._isStart = false;
22
- this.visible = visible;
23
- this.autoUpdate = false;
24
- //如果存在挂点
25
- if (followPointList === null || followPointList === void 0 ? void 0 : followPointList.length) {
26
- followPointList === null || followPointList === void 0 ? void 0 : followPointList.forEach((item) => {
27
- item.follow.alpha = 0;
28
- this._followDots.push({
29
- point: this.skeleton.findBone(item.boneName),
30
- follow: item.follow,
31
- onUpdate: item.onUpdate,
32
- angleFollow: item.angleFollow || false,
33
- scaleFollow: item.scaleFollow || true,
34
- });
35
- });
36
- }
37
- this._loopFn = this._loop.bind(this);
38
- Ticker.system.add(this._loopFn);
39
- }
40
- /** @description 设置动画
41
- * @param animationName 动画名称
42
- * @param loop 是否循环播放
43
- */
44
- setAnimation(animationName = "animation", loop = false) {
45
- return new Promise((resolve) => {
46
- this.visible = true;
47
- this.state.setAnimation(0, animationName, loop).listener = {
48
- complete: () => {
49
- resolve();
50
- },
51
- };
52
- });
53
- }
54
- /** @description 添加动画
55
- * @param animationName 动画名称
56
- * @param loop 是否循环播放
57
- * @param delay 延迟播放时间
58
- */
59
- addAnimation(animationName = "animation", loop = false, delay = 0) {
60
- return new Promise((resolve) => {
61
- this.visible = true;
62
- this.state.addAnimation(0, animationName, loop, delay).listener = {
63
- complete: () => {
64
- resolve();
65
- },
66
- };
67
- });
68
- }
69
- /** @description 改变骨骼数据 */
70
- setSkin(skinName) {
71
- this.skeleton.setSkinByName(skinName);
72
- }
73
- /** @description 销毁动画及挂点 */
74
- destroyAll() {
75
- Ticker.system.remove(this._loopFn);
76
- this.destroy();
77
- }
78
- /** @description 更新渲染 */
79
- _loop() {
80
- this.update(Ticker.system.deltaMS / 1000);
81
- this._updateFollowPoint();
82
- }
83
- /** @description 更新挂点 */
84
- _updateFollowPoint() {
85
- if (this._followDots.length === 0)
86
- return;
87
- this._followDots.forEach((item) => {
88
- const { worldX: x, worldY: y } = item.point;
89
- const rotate = item.point.getWorldRotationX() * (Math.PI / 180);
90
- const scaleX = item.point.getWorldScaleX();
91
- const scaleY = item.point.getWorldScaleY();
92
- if (item.onUpdate) {
93
- item.onUpdate({
94
- x,
95
- y,
96
- rotate,
97
- scaleX,
98
- scaleY,
99
- });
100
- }
101
- else {
102
- if (item.angleFollow) {
103
- item.follow.rotation = rotate;
104
- }
105
- if (item.scaleFollow) {
106
- item.follow.scale.set(scaleX, scaleY);
107
- }
108
- item.follow.position.set(x + 1920 / 2 - item.follow.width / 2, y + 1080 / 2 - item.follow.height / 2);
109
- }
110
- });
111
- if (!this._isStart) {
112
- this._isStart = true;
113
- this._followDots.forEach((item) => {
114
- gsap.to(item.follow, {
115
- alpha: 1,
116
- duration: 0.25,
117
- delay: 0.15,
118
- });
119
- });
120
- }
121
- }
122
- }
@@ -1,37 +0,0 @@
1
- import { Text, type TextStyleAlign, type TextStyleFontWeight } from "pixi.js";
2
- export interface LibPixiTextParams {
3
- /** 文本内容 */
4
- text: string | number;
5
- /** 字体大小 */
6
- fontSize?: number;
7
- /** 字体颜色 */
8
- fontColor?: any;
9
- /** 是否描边 */
10
- stroke?: boolean;
11
- /** 描边颜色 */
12
- strokeColor?: string | number;
13
- /** 描边宽度 */
14
- strokeThickness?: number;
15
- /** 字体样式 */
16
- fontFamily?: string;
17
- /** 字体粗细 */
18
- fontWeight?: TextStyleFontWeight;
19
- /** 是否换行 */
20
- wordWrap?: boolean;
21
- /** 换行宽度 */
22
- wordWrapWidth?: number;
23
- /** 行高 */
24
- lineHeight?: number;
25
- /** 对齐方式 */
26
- align?: TextStyleAlign;
27
- /** 缩进,单位为字数 */
28
- indent?: number;
29
- /** 阴影-颜色 角度 模糊度 阴影距离 */
30
- shadow?: [string, number, number, number];
31
- }
32
- /** @description 自定义文本类
33
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiText-文本
34
- */
35
- export declare class LibPixiText extends Text {
36
- constructor(options: LibPixiTextParams);
37
- }
@@ -1,32 +0,0 @@
1
- import { Text, TextStyle } from "pixi.js";
2
- /** @description 自定义文本类
3
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiText-文本
4
- */
5
- export class LibPixiText extends Text {
6
- constructor(options) {
7
- const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeColor, strokeThickness, fontFamily = "MicrosoftYaHei", fontWeight = "normal", wordWrap = false, wordWrapWidth = 100, lineHeight = 1.25, align = "left", indent = 0, shadow, } = options;
8
- const style = new TextStyle({
9
- fontSize,
10
- wordWrap,
11
- wordWrapWidth,
12
- fontWeight,
13
- lineHeight: lineHeight * fontSize,
14
- breakWords: wordWrap,
15
- fill: fontColor,
16
- align,
17
- fontFamily: fontFamily,
18
- stroke: stroke ? strokeColor : "transparent",
19
- strokeThickness: stroke ? strokeThickness : 0,
20
- lineJoin: "round",
21
- });
22
- if (shadow) {
23
- style.dropShadow = true;
24
- style.dropShadowColor = shadow[0];
25
- style.dropShadowAngle = shadow[1] * (Math.PI / 180);
26
- style.dropShadowBlur = shadow[2];
27
- style.dropShadowDistance = shadow[3];
28
- }
29
- super(text, style);
30
- this.position.x = indent * fontSize;
31
- }
32
- }
@@ -1,32 +0,0 @@
1
- import { Container, type Texture } from "pixi.js";
2
- export interface LibPixiButtonHoverParams {
3
- /** 图标资源 */
4
- texture: Texture;
5
- /** 悬浮图标 */
6
- hoverTexture: Texture;
7
- /** 染色 */
8
- tintColor?: string;
9
- }
10
- /** @description 悬浮切换材质
11
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiButtonHover-按钮悬浮
12
- */
13
- export declare class LibPixiButtonHover extends Container {
14
- /** 按钮 */
15
- private _btn;
16
- /** 默认材质 */
17
- private _texture;
18
- /** 悬浮材质 */
19
- private _hoverTexture;
20
- /** 染色 */
21
- private _tintColor?;
22
- constructor(params: LibPixiButtonHoverParams);
23
- /** @description 切换材质
24
- * @param texture 默认材质
25
- * @param hoverTexture 悬浮材质
26
- */
27
- toggleTexture(texture: Texture, hoverTexture: Texture): void;
28
- /** @description 屏蔽
29
- * @param status 状态
30
- */
31
- setDisabled(status: boolean): void;
32
- }
@@ -1,44 +0,0 @@
1
- import { Container, Sprite } from "pixi.js";
2
- import { libPixiEvent } from "../../Utils/LibPixiEvent";
3
- /** @description 悬浮切换材质
4
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiButtonHover-按钮悬浮
5
- */
6
- export class LibPixiButtonHover extends Container {
7
- constructor(params) {
8
- super();
9
- const { texture, hoverTexture, tintColor } = params;
10
- this._texture = texture;
11
- this._hoverTexture = hoverTexture;
12
- this._tintColor = tintColor;
13
- //创建图标容器
14
- const iconBox = new Container();
15
- this.addChild(iconBox);
16
- //创建图标
17
- this._btn = new Sprite(texture);
18
- iconBox.addChild(this._btn);
19
- tintColor && (this._btn.tint = tintColor);
20
- libPixiEvent(iconBox, "pointerenter", () => {
21
- this._btn._texture = this._hoverTexture;
22
- this._btn.tint = "#fff";
23
- });
24
- libPixiEvent(iconBox, "pointerleave", () => {
25
- this._btn._texture = this._texture;
26
- tintColor && (this._btn.tint = tintColor);
27
- });
28
- }
29
- /** @description 切换材质
30
- * @param texture 默认材质
31
- * @param hoverTexture 悬浮材质
32
- */
33
- toggleTexture(texture, hoverTexture) {
34
- this._texture = texture;
35
- this._hoverTexture = hoverTexture;
36
- this._btn._texture = hoverTexture;
37
- }
38
- /** @description 屏蔽
39
- * @param status 状态
40
- */
41
- setDisabled(status) {
42
- this._btn.tint = status ? "#7C7C7C" : this._tintColor || "#fff";
43
- }
44
- }
@@ -1,14 +0,0 @@
1
- import { LibPixiContainer } from "../Base/LibPixiContainer";
2
- import type { Sprite } from "pixi.js";
3
- export interface LibPixiCloseBtnParams {
4
- /** 按钮素材 */
5
- sprite: Sprite;
6
- /** 点击回调 */
7
- onClick: () => void;
8
- }
9
- /** @description 右上角关闭按钮,支持悬浮旋转动画
10
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiCloseBtn-关闭按钮
11
- */
12
- export declare class LibPixiCloseBtn extends LibPixiContainer {
13
- constructor(params: LibPixiCloseBtnParams);
14
- }
@@ -1,35 +0,0 @@
1
- import gsap from "gsap";
2
- import { LibPixiContainer } from "../Base/LibPixiContainer";
3
- import { libPixiEvent } from "../../Utils/LibPixiEvent";
4
- /** @description 右上角关闭按钮,支持悬浮旋转动画
5
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiCloseBtn-关闭按钮
6
- */
7
- export class LibPixiCloseBtn extends LibPixiContainer {
8
- constructor(params) {
9
- const { sprite, onClick } = params;
10
- super(sprite.width, sprite.height);
11
- this.addChild(sprite);
12
- sprite.anchor.set(0.5);
13
- sprite.x = sprite.width / 2;
14
- sprite.y = sprite.height / 2;
15
- libPixiEvent(this, "pointerenter", () => {
16
- gsap.to(sprite, {
17
- duration: 0.25,
18
- rotation: 180 * (Math.PI / 180),
19
- });
20
- });
21
- libPixiEvent(this, "pointerleave", () => {
22
- sprite.alpha = 1;
23
- gsap.to(sprite, {
24
- duration: 0.25,
25
- rotation: 0,
26
- });
27
- });
28
- libPixiEvent(this, "pointerdown", () => {
29
- sprite.alpha = 0.5;
30
- });
31
- libPixiEvent(this, "pointerup", () => {
32
- onClick();
33
- });
34
- }
35
- }
@@ -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,31 +0,0 @@
1
- import { Application, Container } from "pixi.js";
2
- /** @description 监视帧率、Draw Call、Max Draw Call
3
- * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiPerforMon-性能监视器
4
- */
5
- export declare class LibPixiPerforMon extends Container {
6
- /** 数据收集时间间隔 (5秒) */
7
- private readonly COLLECT_TIME;
8
- /** 当前时间 */
9
- private _nowTime;
10
- /** 上次更新的时间 */
11
- private _lastTime;
12
- /** 当前绘制调用次数 */
13
- private _drawCount;
14
- /** 最大绘制调用次数 */
15
- private _maxDrawCount;
16
- /** 临时最大绘制调用次数 */
17
- private _tempMaxDrawCount;
18
- /** 上次收集数据的时间 */
19
- private _lastCollectTime;
20
- /** 渲染器 */
21
- private _renderer;
22
- /** 存储每个性能指标的文本对象 */
23
- private _paramTxts;
24
- /** 原始的 drawElements 方法 */
25
- private _drawElements;
26
- constructor(app: Application);
27
- /** @description 初始化显示性能数据 */
28
- init(): void;
29
- /** @description 更新文本信息 */
30
- private _setTxtInfo;
31
- }