lyb-pixi-js 1.9.11 → 1.9.12

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.
@@ -89,7 +89,6 @@ export class LibPixiParticleMove extends Container {
89
89
  const text = new LibPixiText({
90
90
  text: index + 1,
91
91
  fontSize: 20,
92
- stroke: true,
93
92
  strokeColor: "#000",
94
93
  strokeThickness: 1,
95
94
  });
@@ -6,8 +6,6 @@ export interface LibPixiTextParams {
6
6
  fontSize?: number;
7
7
  /** 字体颜色 */
8
8
  fontColor?: any;
9
- /** 是否描边 */
10
- stroke?: boolean;
11
9
  /** 描边颜色 */
12
10
  strokeColor?: string | number;
13
11
  /** 描边宽度 */
@@ -1,10 +1,10 @@
1
- import { Text, TextStyle } from "pixi.js";
1
+ import { Text, TextStyle, } from "pixi.js";
2
2
  /** @description 自定义文本类
3
3
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiText-文本
4
4
  */
5
5
  export class LibPixiText extends Text {
6
6
  constructor(options) {
7
- const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeColor, strokeThickness, fontFamily = "Arial", fontWeight = "normal", wordWrap = false, wordWrapWidth = 100, lineHeight = 1.25, align = "left", indent = 0, shadow, } = options;
7
+ const { text, fontSize = 36, fontColor = 0xffffff, strokeColor, strokeThickness, fontFamily = "Arial", fontWeight = "normal", wordWrap = false, wordWrapWidth = 100, lineHeight = 1.25, align = "left", indent = 0, shadow, } = options;
8
8
  const style = new TextStyle({
9
9
  fontSize,
10
10
  wordWrap,
@@ -15,8 +15,8 @@ export class LibPixiText extends Text {
15
15
  fill: fontColor,
16
16
  align,
17
17
  fontFamily: fontFamily,
18
- stroke: stroke ? strokeColor : "transparent",
19
- strokeThickness: stroke ? strokeThickness : 0,
18
+ stroke: strokeColor ? strokeColor : "transparent",
19
+ strokeThickness: strokeThickness ? strokeThickness : 0,
20
20
  lineJoin: "round",
21
21
  });
22
22
  if (shadow) {
@@ -1,6 +1,7 @@
1
1
  import { Container } from "pixi.js";
2
2
  /** @description 按下放大
3
3
  * @param container 要放大的容器
4
+ * @param type 缩放类型
4
5
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiDownScaleAnimation-按下放大
5
6
  */
6
- export declare const LibPixiDownScaleAnimation: (container: Container) => void;
7
+ export declare const LibPixiDownScaleAnimation: (container: Container, type?: "small" | "big") => void;
@@ -2,14 +2,15 @@ import { libPixiEvent } from "./LibPixiEvent";
2
2
  import gsap from "gsap";
3
3
  /** @description 按下放大
4
4
  * @param container 要放大的容器
5
+ * @param type 缩放类型
5
6
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiDownScaleAnimation-按下放大
6
7
  */
7
- export const LibPixiDownScaleAnimation = (container) => {
8
+ export const LibPixiDownScaleAnimation = (container, type = "big") => {
8
9
  libPixiEvent(container, "pointerdown", () => {
9
10
  gsap.to(container, {
10
11
  duration: 0.1,
11
12
  pixi: {
12
- scale: 1.1,
13
+ scale: type === "big" ? 1.1 : 0.9,
13
14
  },
14
15
  });
15
16
  });
package/libPixiJs.d.ts CHANGED
@@ -208,7 +208,7 @@ export declare const Utils: {
208
208
  * @param container 要放大的容器
209
209
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiDownScaleAnimation-按下放大
210
210
  */
211
- LibPixiDownScaleAnimation: (container: import("pixi.js").Container) => void;
211
+ LibPixiDownScaleAnimation: (container: import("pixi.js").Container, type?: "small" | "big") => void;
212
212
  /**
213
213
  * @description 将元素按照指定的列数和间隔排列成网格布局。
214
214
  * @param items 要排列的元素数组
package/lyb-pixi.js CHANGED
@@ -31857,7 +31857,6 @@ void main(void)\r
31857
31857
  text,
31858
31858
  fontSize = 36,
31859
31859
  fontColor = 16777215,
31860
- stroke,
31861
31860
  strokeColor,
31862
31861
  strokeThickness,
31863
31862
  fontFamily = "Arial",
@@ -31879,8 +31878,8 @@ void main(void)\r
31879
31878
  fill: fontColor,
31880
31879
  align,
31881
31880
  fontFamily,
31882
- stroke: stroke ? strokeColor : "transparent",
31883
- strokeThickness: stroke ? strokeThickness : 0,
31881
+ stroke: strokeColor ? strokeColor : "transparent",
31882
+ strokeThickness: strokeThickness ? strokeThickness : 0,
31884
31883
  lineJoin: "round"
31885
31884
  });
31886
31885
  if (shadow) {
@@ -31990,7 +31989,6 @@ void main(void)\r
31990
31989
  const text = new LibPixiText({
31991
31990
  text: index + 1,
31992
31991
  fontSize: 20,
31993
- stroke: true,
31994
31992
  strokeColor: "#000",
31995
31993
  strokeThickness: 1
31996
31994
  });
@@ -55091,12 +55089,12 @@ void main(void){
55091
55089
  amountAnimation.progress(1);
55092
55090
  };
55093
55091
  };
55094
- const LibPixiDownScaleAnimation = (container) => {
55092
+ const LibPixiDownScaleAnimation = (container, type2 = "big") => {
55095
55093
  libPixiEvent(container, "pointerdown", () => {
55096
55094
  gsapWithCSS.to(container, {
55097
55095
  duration: 0.1,
55098
55096
  pixi: {
55099
- scale: 1.1
55097
+ scale: type2 === "big" ? 1.1 : 0.9
55100
55098
  }
55101
55099
  });
55102
55100
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.9.11",
3
+ "version": "1.9.12",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "exports": {