three-base 1.0.59 → 1.0.60
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.
- package/index.ts +5 -1
- package/lib/Text3D/Text3D.ts +88 -0
- package/lib/Text3D/fontController.ts +285 -0
- package/lib/Text3D/gentilis.json +811 -0
- package/lib/planeModal1/PlaneModal1.ts +4 -1
- package/lib/spriteModal1/SpriteModal1.ts +4 -0
- package/package.json +2 -1
- package/lib/text/Text2D.ts +0 -41
- package/lib/text/Text3D.ts +0 -22
|
@@ -30,11 +30,14 @@ export default class PlaneModal1 extends Mesh {
|
|
|
30
30
|
this.scale.set(10, 10, 10);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
renderOrder = 99;
|
|
34
|
+
|
|
33
35
|
geometry = new PlaneGeometry(1 * 0.65, 0.728 * 0.65, 1, 1);
|
|
34
36
|
|
|
35
37
|
material = new MeshBasicMaterial({
|
|
36
38
|
side: DoubleSide,
|
|
37
|
-
transparent: true
|
|
39
|
+
transparent: true,
|
|
40
|
+
alphaTest: 0.01
|
|
38
41
|
});
|
|
39
42
|
|
|
40
43
|
// 背景图
|
|
@@ -30,8 +30,12 @@ export default class SpritModal1 extends Sprite {
|
|
|
30
30
|
super();
|
|
31
31
|
this.updata(config);
|
|
32
32
|
this.material.map = this.texture;
|
|
33
|
+
this.material.transparent = true;
|
|
34
|
+
this.material.alphaTest = 0.01;
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
renderOrder = 99;
|
|
38
|
+
|
|
35
39
|
// 背景图
|
|
36
40
|
static img = (() => {
|
|
37
41
|
const img = new Image();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "three-base",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.60",
|
|
4
4
|
"description": "three 3d three-base",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"lodash": "^4",
|
|
44
44
|
"three": ">=0.150.0",
|
|
45
45
|
"vite": "^4",
|
|
46
|
+
"dexie": "^3",
|
|
46
47
|
"three-spritetext": "^1",
|
|
47
48
|
"@types/three": ">=0.149.0",
|
|
48
49
|
"@types/element-resize-event": "^3",
|
package/lib/text/Text2D.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: xiaosihan
|
|
3
|
-
* @Date: 2022-05-23 13:53:06
|
|
4
|
-
* @Last Modified by: xiaosihan
|
|
5
|
-
* @Last Modified time: 2022-05-23 19:38:24
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { DoubleSide, Mesh, MeshBasicMaterial, PlaneGeometry, Vector3 } from "three";
|
|
9
|
-
import SpriteText from "three-spritetext";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type Props = {
|
|
14
|
-
text?: string;
|
|
15
|
-
textHeight?: number;
|
|
16
|
-
color?: string;
|
|
17
|
-
backgroundColor?: string;
|
|
18
|
-
fontFace?: string;
|
|
19
|
-
fontSize?: number;
|
|
20
|
-
fontWeight?: string;
|
|
21
|
-
padding?: number | [number, number];
|
|
22
|
-
borderWidth?: number;
|
|
23
|
-
borderRadius?: number;
|
|
24
|
-
borderColor?: string;
|
|
25
|
-
strokeWidth?: number;
|
|
26
|
-
strokeColor?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* 2d文字
|
|
31
|
-
* @export
|
|
32
|
-
* @class PlaneBtn
|
|
33
|
-
* @extends {Mesh}
|
|
34
|
-
*/
|
|
35
|
-
export default class Text2D extends Mesh {
|
|
36
|
-
|
|
37
|
-
constructor(text: string = "Text2D") {
|
|
38
|
-
super();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
}
|
package/lib/text/Text3D.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: xiaosihan
|
|
3
|
-
* @Date: 2022-06-14 09:48:00
|
|
4
|
-
* @Last Modified by: xiaosihan
|
|
5
|
-
* @Last Modified time: 2022-06-14 10:01:13
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { Mesh } from "three";
|
|
9
|
-
|
|
10
|
-
// 三维空间中的3D文字模型
|
|
11
|
-
export default class Text3D extends Mesh {
|
|
12
|
-
|
|
13
|
-
constructor(text: string = "Text3D") {
|
|
14
|
-
super();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// 字体的存储路径
|
|
18
|
-
static path: "http://drm.gitee.io/xsh-react-three-font/";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|