lyb-pixi-js 1.9.2 → 1.9.4
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.
|
@@ -44,12 +44,14 @@ export class LibPixiSpine extends Spine {
|
|
|
44
44
|
*/
|
|
45
45
|
setAnimation(animationName = "animation", loop = false) {
|
|
46
46
|
return new Promise((resolve) => {
|
|
47
|
-
this.visible = true;
|
|
48
47
|
this.state.setAnimation(0, animationName, loop).listener = {
|
|
49
48
|
complete: () => {
|
|
50
49
|
resolve();
|
|
51
50
|
},
|
|
52
51
|
};
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
this.visible = true;
|
|
54
|
+
});
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
/** @description 添加动画
|
|
@@ -59,7 +61,6 @@ export class LibPixiSpine extends Spine {
|
|
|
59
61
|
*/
|
|
60
62
|
addAnimation(animationName = "animation", loop = false, delay = 0) {
|
|
61
63
|
return new Promise((resolve) => {
|
|
62
|
-
this.visible = true;
|
|
63
64
|
this.state.addAnimation(0, animationName, loop, delay).listener = {
|
|
64
65
|
complete: () => {
|
|
65
66
|
resolve();
|
|
@@ -16,7 +16,7 @@ export interface LibPixiScrollContainerYParams {
|
|
|
16
16
|
/** 滚动条颜色 */
|
|
17
17
|
scrollbarColor?: string;
|
|
18
18
|
/** 滚动触发 */
|
|
19
|
-
onScroll
|
|
19
|
+
onScroll?: (y: number) => void;
|
|
20
20
|
}
|
|
21
21
|
/** @description 支持鼠标滚轮滚动、鼠标拖动、手指滑动,支持惯性滚动及回弹
|
|
22
22
|
* @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiScrollContainerY-Y 轴滚动容器
|
|
@@ -49,7 +49,7 @@ export declare class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
49
49
|
/** 滚动条颜色 */
|
|
50
50
|
private _scrollbarColor;
|
|
51
51
|
/** 滚动触发 */
|
|
52
|
-
private _onScroll
|
|
52
|
+
private _onScroll?;
|
|
53
53
|
constructor(params: LibPixiScrollContainerYParams);
|
|
54
54
|
/** @description 设置滚动容器可视区宽高
|
|
55
55
|
* @param width 宽度
|
|
@@ -238,6 +238,7 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
238
238
|
}
|
|
239
239
|
/** @description 更新滚动位置 */
|
|
240
240
|
_updateScrollbar() {
|
|
241
|
+
var _a;
|
|
241
242
|
this._scrollbar.alpha = 1;
|
|
242
243
|
gsap.killTweensOf(this._scrollbar);
|
|
243
244
|
const viewHeight = this._maskGraphics.height;
|
|
@@ -248,7 +249,7 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
248
249
|
const scrollY = Math.min(Math.max(-this._content.y, 0), maxScrollY);
|
|
249
250
|
const barY = (scrollY / maxScrollY) * (viewHeight - barHeight);
|
|
250
251
|
this._scrollbar.y = barY;
|
|
251
|
-
this._onScroll(this._content.y);
|
|
252
|
+
(_a = this._onScroll) === null || _a === void 0 ? void 0 : _a.call(this, this._content.y);
|
|
252
253
|
}
|
|
253
254
|
/** @description 更新滚动条大小 */
|
|
254
255
|
_updateScrollbarSize() {
|
package/lyb-pixi.js
CHANGED
|
@@ -48701,12 +48701,14 @@ void main(void)\r
|
|
|
48701
48701
|
*/
|
|
48702
48702
|
setAnimation(animationName = "animation", loop = false) {
|
|
48703
48703
|
return new Promise((resolve) => {
|
|
48704
|
-
this.visible = true;
|
|
48705
48704
|
this.state.setAnimation(0, animationName, loop).listener = {
|
|
48706
48705
|
complete: () => {
|
|
48707
48706
|
resolve();
|
|
48708
48707
|
}
|
|
48709
48708
|
};
|
|
48709
|
+
setTimeout(() => {
|
|
48710
|
+
this.visible = true;
|
|
48711
|
+
});
|
|
48710
48712
|
});
|
|
48711
48713
|
}
|
|
48712
48714
|
/** @description 添加动画
|
|
@@ -48716,7 +48718,6 @@ void main(void)\r
|
|
|
48716
48718
|
*/
|
|
48717
48719
|
addAnimation(animationName = "animation", loop = false, delay = 0) {
|
|
48718
48720
|
return new Promise((resolve) => {
|
|
48719
|
-
this.visible = true;
|
|
48720
48721
|
this.state.addAnimation(0, animationName, loop, delay).listener = {
|
|
48721
48722
|
complete: () => {
|
|
48722
48723
|
resolve();
|
|
@@ -49477,6 +49478,7 @@ void main(void)\r
|
|
|
49477
49478
|
}
|
|
49478
49479
|
/** @description 更新滚动位置 */
|
|
49479
49480
|
_updateScrollbar() {
|
|
49481
|
+
var _a;
|
|
49480
49482
|
this._scrollbar.alpha = 1;
|
|
49481
49483
|
gsapWithCSS.killTweensOf(this._scrollbar);
|
|
49482
49484
|
const viewHeight = this._maskGraphics.height;
|
|
@@ -49487,7 +49489,7 @@ void main(void)\r
|
|
|
49487
49489
|
const scrollY = Math.min(Math.max(-this._content.y, 0), maxScrollY);
|
|
49488
49490
|
const barY = scrollY / maxScrollY * (viewHeight - barHeight);
|
|
49489
49491
|
this._scrollbar.y = barY;
|
|
49490
|
-
this._onScroll(this._content.y);
|
|
49492
|
+
(_a = this._onScroll) == null ? void 0 : _a.call(this, this._content.y);
|
|
49491
49493
|
}
|
|
49492
49494
|
/** @description 更新滚动条大小 */
|
|
49493
49495
|
_updateScrollbarSize() {
|