lyb-pixi-js 1.12.71 → 1.12.73

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.
@@ -22,6 +22,8 @@ export interface LibPixiHtmlTextParams {
22
22
  align?: TextStyleAlign;
23
23
  /** 阴影-颜色 角度 模糊度 阴影距离 */
24
24
  shadow?: [string, number, number, number];
25
+ /** 按照单词换行 */
26
+ breakWord?: boolean;
25
27
  }
26
28
  /** @description 自定义富文本类
27
29
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiHtmlText-富文本
@@ -4,14 +4,14 @@ import { HTMLText, } from "pixi.js";
4
4
  */
5
5
  export class LibPixiHtmlText extends HTMLText {
6
6
  constructor(options) {
7
- const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeThickness, fontFamily = "Arial", fontWeight = "normal", wordWrapWidth, lineHeight = 1.25, align = "left", shadow, } = options;
7
+ const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeThickness, fontFamily = "Arial", fontWeight = "normal", wordWrapWidth, lineHeight = 1.25, align = "left", shadow, breakWord = true, } = options;
8
8
  super(text.toString(), {
9
9
  fontSize,
10
10
  wordWrap: !!wordWrapWidth,
11
11
  wordWrapWidth,
12
12
  fontWeight,
13
13
  lineHeight: lineHeight * fontSize,
14
- breakWords: !!wordWrapWidth,
14
+ breakWords: breakWord,
15
15
  fill: fontColor,
16
16
  align,
17
17
  whiteSpace: "pre-line",
@@ -26,6 +26,8 @@ export interface LibPixiTextParams {
26
26
  indent?: number;
27
27
  /** 阴影-颜色 角度 模糊度 阴影距离 */
28
28
  shadow?: [string, number, number, number];
29
+ /** 按照单词换行 */
30
+ breakWord?: boolean;
29
31
  }
30
32
  /** @description 自定义文本类
31
33
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiText-文本
@@ -4,14 +4,14 @@ import { Text, TEXT_GRADIENT, TextStyle, } from "pixi.js";
4
4
  */
5
5
  export class LibPixiText extends Text {
6
6
  constructor(options) {
7
- const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeThickness, fontFamily = "Arial", fontWeight = "normal", wordWrapWidth, lineHeight = 1, align = "left", indent = 0, shadow, gradientDirection, } = options;
7
+ const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeThickness, fontFamily = "Arial", fontWeight = "normal", wordWrapWidth, lineHeight = 1, align = "left", indent = 0, shadow, gradientDirection, breakWord = true, } = options;
8
8
  const style = new TextStyle({
9
9
  fontSize,
10
10
  wordWrap: !!wordWrapWidth,
11
11
  wordWrapWidth,
12
12
  fontWeight,
13
13
  lineHeight: lineHeight * fontSize,
14
- breakWords: !!wordWrapWidth,
14
+ breakWords: breakWord,
15
15
  fill: fontColor,
16
16
  align,
17
17
  fontFamily: LibPixiText.fontFamily || fontFamily,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.12.71",
3
+ "version": "1.12.73",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "exports": {