lyb-pixi-js 1.9.12 → 1.9.14
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.
|
@@ -6,10 +6,8 @@ export interface LibPixiHtmlTextParams {
|
|
|
6
6
|
fontSize?: number;
|
|
7
7
|
/** 字体颜色 */
|
|
8
8
|
fontColor?: any;
|
|
9
|
-
/** 是否描边 */
|
|
10
|
-
stroke?: boolean;
|
|
11
9
|
/** 描边颜色 */
|
|
12
|
-
|
|
10
|
+
stroke?: string | number;
|
|
13
11
|
/** 描边宽度 */
|
|
14
12
|
strokeThickness?: number;
|
|
15
13
|
/** 字体样式 */
|
|
@@ -4,7 +4,7 @@ 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,
|
|
7
|
+
const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeThickness, fontFamily = "Arial", fontWeight = "normal", wordWrap = false, wordWrapWidth = 100, lineHeight = 1.25, align = "left", shadow, } = options;
|
|
8
8
|
super(text.toString(), {
|
|
9
9
|
fontSize,
|
|
10
10
|
wordWrap,
|
|
@@ -16,8 +16,8 @@ export class LibPixiHtmlText extends HTMLText {
|
|
|
16
16
|
align,
|
|
17
17
|
whiteSpace: "pre-line",
|
|
18
18
|
fontFamily: fontFamily,
|
|
19
|
-
stroke: stroke ?
|
|
20
|
-
strokeThickness:
|
|
19
|
+
stroke: stroke ? stroke : "transparent",
|
|
20
|
+
strokeThickness: strokeThickness ? strokeThickness : 0,
|
|
21
21
|
});
|
|
22
22
|
if (shadow) {
|
|
23
23
|
this.style.dropShadow = true;
|
|
@@ -4,7 +4,7 @@ import { Text, TextStyle, } from "pixi.js";
|
|
|
4
4
|
*/
|
|
5
5
|
export class LibPixiText extends Text {
|
|
6
6
|
constructor(options) {
|
|
7
|
-
const { text, fontSize = 36, fontColor = 0xffffff,
|
|
7
|
+
const { text, fontSize = 36, fontColor = 0xffffff, stroke, 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,7 +15,7 @@ export class LibPixiText extends Text {
|
|
|
15
15
|
fill: fontColor,
|
|
16
16
|
align,
|
|
17
17
|
fontFamily: fontFamily,
|
|
18
|
-
stroke:
|
|
18
|
+
stroke: stroke ? stroke : "transparent",
|
|
19
19
|
strokeThickness: strokeThickness ? strokeThickness : 0,
|
|
20
20
|
lineJoin: "round",
|
|
21
21
|
});
|
package/lyb-pixi.js
CHANGED
|
@@ -31857,7 +31857,7 @@ void main(void)\r
|
|
|
31857
31857
|
text,
|
|
31858
31858
|
fontSize = 36,
|
|
31859
31859
|
fontColor = 16777215,
|
|
31860
|
-
|
|
31860
|
+
stroke,
|
|
31861
31861
|
strokeThickness,
|
|
31862
31862
|
fontFamily = "Arial",
|
|
31863
31863
|
fontWeight = "normal",
|
|
@@ -31878,7 +31878,7 @@ void main(void)\r
|
|
|
31878
31878
|
fill: fontColor,
|
|
31879
31879
|
align,
|
|
31880
31880
|
fontFamily,
|
|
31881
|
-
stroke:
|
|
31881
|
+
stroke: stroke ? stroke : "transparent",
|
|
31882
31882
|
strokeThickness: strokeThickness ? strokeThickness : 0,
|
|
31883
31883
|
lineJoin: "round"
|
|
31884
31884
|
});
|
|
@@ -31989,7 +31989,7 @@ void main(void)\r
|
|
|
31989
31989
|
const text = new LibPixiText({
|
|
31990
31990
|
text: index + 1,
|
|
31991
31991
|
fontSize: 20,
|
|
31992
|
-
|
|
31992
|
+
stroke: "#000",
|
|
31993
31993
|
strokeThickness: 1
|
|
31994
31994
|
});
|
|
31995
31995
|
text.position.set(item.x, item.y);
|
|
@@ -55015,7 +55015,6 @@ void main(void){
|
|
|
55015
55015
|
fontSize = 36,
|
|
55016
55016
|
fontColor = 16777215,
|
|
55017
55017
|
stroke,
|
|
55018
|
-
strokeColor,
|
|
55019
55018
|
strokeThickness,
|
|
55020
55019
|
fontFamily = "Arial",
|
|
55021
55020
|
fontWeight = "normal",
|
|
@@ -55036,8 +55035,8 @@ void main(void){
|
|
|
55036
55035
|
align,
|
|
55037
55036
|
whiteSpace: "pre-line",
|
|
55038
55037
|
fontFamily,
|
|
55039
|
-
stroke: stroke ?
|
|
55040
|
-
strokeThickness:
|
|
55038
|
+
stroke: stroke ? stroke : "transparent",
|
|
55039
|
+
strokeThickness: strokeThickness ? strokeThickness : 0
|
|
55041
55040
|
});
|
|
55042
55041
|
if (shadow) {
|
|
55043
55042
|
this.style.dropShadow = true;
|