@dcl/sdk 7.0.0-3244243254.commit-d5804ee → 7.0.0-3252840030.commit-001810b
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/dist/ecs7/index.d.ts +36 -19
- package/dist/ecs7/index.js +133 -82
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/dist/ecs7/proto-definitions/billboard.proto +10 -4
- package/dist/ecs7/proto-definitions/common/texts.proto +9 -3
- package/dist/ecs7/proto-definitions/text_shape.proto +21 -24
- package/dist/playground/snippets/billboard.ts +87 -0
- package/dist/playground/snippets/info.json +1 -1
- package/package.json +4 -4
- package/types/ecs7/index.d.ts +36 -19
@@ -1,11 +1,17 @@
|
|
1
1
|
syntax = "proto3";
|
2
|
+
|
2
3
|
package decentraland.sdk.components;
|
3
4
|
|
4
5
|
import "decentraland/sdk/components/common/id.proto";
|
6
|
+
|
5
7
|
option (common.ecs_component_id) = 1090;
|
6
8
|
|
9
|
+
enum BillboardMode {
|
10
|
+
BM_ALL_AXES = 0;
|
11
|
+
BM_Y_AXE = 1;
|
12
|
+
}
|
13
|
+
|
7
14
|
message PBBillboard {
|
8
|
-
optional
|
9
|
-
optional bool
|
10
|
-
|
11
|
-
}
|
15
|
+
optional BillboardMode billboard_mode = 1; // default=BM_ALL_AXES
|
16
|
+
optional bool opposite_direction = 2; // default=false
|
17
|
+
}
|
@@ -3,9 +3,15 @@ syntax = "proto3";
|
|
3
3
|
package decentraland.sdk.components.common;
|
4
4
|
|
5
5
|
enum TextAlignMode {
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
TAM_TOP_LEFT = 0;
|
7
|
+
TAM_TOP_CENTER = 1;
|
8
|
+
TAM_TOP_RIGHT = 2;
|
9
|
+
TAM_MIDDLE_LEFT = 3;
|
10
|
+
TAM_MIDDLE_CENTER = 4;
|
11
|
+
TAM_MIDDLE_RIGHT = 5;
|
12
|
+
TAM_BOTTOM_LEFT = 6;
|
13
|
+
TAM_BOTTOM_CENTER = 7;
|
14
|
+
TAM_BOTTOM_RIGHT = 8;
|
9
15
|
}
|
10
16
|
|
11
17
|
enum Font {
|
@@ -4,33 +4,30 @@ package decentraland.sdk.components;
|
|
4
4
|
|
5
5
|
import "decentraland/common/colors.proto";
|
6
6
|
import "decentraland/sdk/components/common/id.proto";
|
7
|
+
import "decentraland/sdk/components/common/texts.proto";
|
7
8
|
|
8
9
|
option (common.ecs_component_id) = 1030;
|
9
10
|
|
10
11
|
message PBTextShape {
|
11
12
|
string text = 1;
|
12
|
-
|
13
|
-
optional
|
14
|
-
optional
|
15
|
-
optional
|
16
|
-
optional float
|
17
|
-
optional
|
18
|
-
optional
|
19
|
-
optional
|
20
|
-
optional float
|
21
|
-
optional float
|
22
|
-
optional float
|
23
|
-
optional
|
24
|
-
optional
|
25
|
-
optional float
|
26
|
-
optional float
|
27
|
-
optional
|
28
|
-
optional
|
29
|
-
optional
|
30
|
-
optional
|
31
|
-
optional
|
32
|
-
optional float outline_width = 21;
|
33
|
-
optional decentraland.common.Color3 shadow_color = 22; // default=(1.0,1.0,1.0)
|
34
|
-
optional decentraland.common.Color3 outline_color = 23; // default=(1.0,1.0,1.0)
|
35
|
-
optional decentraland.common.Color3 text_color = 24; // default=(1.0,1.0,1.0)
|
13
|
+
optional common.Font font = 2; // default=F_SANS_SERIF
|
14
|
+
optional float font_size = 3; // default=10
|
15
|
+
optional bool font_auto_size = 4;
|
16
|
+
optional common.TextAlignMode text_align = 5; // default=TAM_CENTER_CENTER
|
17
|
+
optional float width = 6; // default=1
|
18
|
+
optional float height = 7; // default=1
|
19
|
+
optional float padding_top = 8;
|
20
|
+
optional float padding_right = 9;
|
21
|
+
optional float padding_bottom = 10;
|
22
|
+
optional float padding_left = 11;
|
23
|
+
optional float line_spacing = 12;
|
24
|
+
optional int32 line_count = 13;
|
25
|
+
optional bool text_wrapping = 14;
|
26
|
+
optional float shadow_blur = 15;
|
27
|
+
optional float shadow_offset_x = 16;
|
28
|
+
optional float shadow_offset_y = 17;
|
29
|
+
optional float outline_width = 18;
|
30
|
+
optional decentraland.common.Color3 shadow_color = 19; // default=(1.0,1.0,1.0)
|
31
|
+
optional decentraland.common.Color3 outline_color = 20; // default=(1.0,1.0,1.0)
|
32
|
+
optional decentraland.common.Color4 text_color = 21; // default=(1.0,1.0,1.0)
|
36
33
|
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
function createPlaneTexture(x: number, y: number, z: number): Entity {
|
2
|
+
const meshEntity = engine.addEntity()
|
3
|
+
|
4
|
+
Material.create(meshEntity, {
|
5
|
+
texture: { src: 'models/polaroid2.png' }
|
6
|
+
})
|
7
|
+
Transform.create(meshEntity, {
|
8
|
+
position: { x, y, z },
|
9
|
+
scale: Vector3.create(2, 2, 2)
|
10
|
+
})
|
11
|
+
MeshRenderer.create(meshEntity, {
|
12
|
+
plane: {
|
13
|
+
uvs: [...Array.from({ length: 40 }, () => 0), 0, 1, 1, 1, 1, 0, 0, 0]
|
14
|
+
}
|
15
|
+
})
|
16
|
+
return meshEntity
|
17
|
+
}
|
18
|
+
|
19
|
+
function createBillboards() {
|
20
|
+
Billboard.create(createPlaneTexture(8, 3, 1), {
|
21
|
+
billboardMode: BillboardMode.BM_Y_AXE
|
22
|
+
})
|
23
|
+
Billboard.create(createPlaneTexture(12, 3, 1))
|
24
|
+
createPlaneTexture(4, 3, 1)
|
25
|
+
|
26
|
+
Billboard.create(createPlaneTexture(8, 3, 8), {
|
27
|
+
oppositeDirection: true,
|
28
|
+
billboardMode: BillboardMode.BM_Y_AXE
|
29
|
+
})
|
30
|
+
Billboard.create(createPlaneTexture(12, 3, 8), {
|
31
|
+
oppositeDirection: true,
|
32
|
+
billboardMode: BillboardMode.BM_ALL_AXES
|
33
|
+
})
|
34
|
+
createPlaneTexture(4, 3, 8)
|
35
|
+
}
|
36
|
+
|
37
|
+
function createTextShape(text: string, position: Vector3.ReadonlyVector3) {
|
38
|
+
const entity = engine.addEntity()
|
39
|
+
Transform.create(entity, { position })
|
40
|
+
return TextShape.create(entity, { text })
|
41
|
+
}
|
42
|
+
|
43
|
+
function createTextShapes() {
|
44
|
+
const text1 = createTextShape(
|
45
|
+
'Regular, only Y-rotation',
|
46
|
+
Vector3.create(8, 1, 1)
|
47
|
+
)
|
48
|
+
text1.fontSize = 3
|
49
|
+
text1.textColor = { r: 1, g: 0.2, b: 0.8, a: 0.8 }
|
50
|
+
text1.outlineColor = { r: 0, g: 0, b: 0 }
|
51
|
+
text1.outlineWidth = 0.1
|
52
|
+
|
53
|
+
const text2 = createTextShape('Regular', Vector3.create(12, 1, 1))
|
54
|
+
text2.fontSize = 3
|
55
|
+
text2.textColor = { r: 1, g: 0.2, b: 0.8, a: 0.8 }
|
56
|
+
text2.outlineColor = { r: 0, g: 0, b: 0 }
|
57
|
+
text2.outlineWidth = 0.1
|
58
|
+
|
59
|
+
const text3 = createTextShape('Without billboard', Vector3.create(4, 1, 1))
|
60
|
+
text3.fontSize = 3
|
61
|
+
text3.textColor = { r: 1, g: 0.2, b: 0.8, a: 0.8 }
|
62
|
+
text3.outlineColor = { r: 0, g: 0, b: 0 }
|
63
|
+
text3.outlineWidth = 0.1
|
64
|
+
|
65
|
+
const text4 = createTextShape('Opposite, only Y', Vector3.create(8, 1, 8))
|
66
|
+
text4.fontSize = 3
|
67
|
+
text4.textColor = { r: 0.8, g: 0.2, b: 1.0, a: 0.8 }
|
68
|
+
text4.outlineColor = { r: 0, g: 0, b: 0 }
|
69
|
+
text4.outlineWidth = 0.1
|
70
|
+
|
71
|
+
const text5 = createTextShape('Opposite', Vector3.create(12, 1, 8))
|
72
|
+
text5.fontSize = 3
|
73
|
+
text5.textColor = { r: 0.8, g: 0.2, b: 1.0, a: 0.8 }
|
74
|
+
text5.outlineColor = { r: 0, g: 0, b: 0 }
|
75
|
+
text5.outlineWidth = 0.1
|
76
|
+
|
77
|
+
const text6 = createTextShape('Without billboard', Vector3.create(4, 1, 8))
|
78
|
+
text6.fontSize = 3
|
79
|
+
text6.textColor = { r: 0.8, g: 0.2, b: 1.0, a: 0.8 }
|
80
|
+
text6.outlineColor = { r: 0, g: 0, b: 0 }
|
81
|
+
text6.outlineWidth = 0.1
|
82
|
+
}
|
83
|
+
|
84
|
+
createBillboards()
|
85
|
+
createTextShapes()
|
86
|
+
|
87
|
+
|
@@ -1 +1 @@
|
|
1
|
-
[{"name":"Cube Spawner","category":"sample","path":"cube-spawner.ts"},{"name":"Material","category":"component","path":"material.ts"},{"name":"Mesh","category":"component","path":"mesh.ts"},{"name":"Pointer Events","category":"sample","path":"pointer-events.ts"},{"name":"Raycast Hit","category":"component","path":"raycast-hit.ts"},{"name":"Raycast Hit many","category":"sample","path":"raycast-hit-many.ts"},{"name":"Raycast Hit Oscilator","category":"sample","path":"raycast-hit-oscilator.ts"},{"name":"Container","category":"ui","path":"ui.tsx"}]
|
1
|
+
[{"name":"Billboard","category":"sample","path":"billboard.ts"},{"name":"Cube Spawner","category":"sample","path":"cube-spawner.ts"},{"name":"Material","category":"component","path":"material.ts"},{"name":"Mesh","category":"component","path":"mesh.ts"},{"name":"Pointer Events","category":"sample","path":"pointer-events.ts"},{"name":"Raycast Hit","category":"component","path":"raycast-hit.ts"},{"name":"Raycast Hit many","category":"sample","path":"raycast-hit-many.ts"},{"name":"Raycast Hit Oscilator","category":"sample","path":"raycast-hit-oscilator.ts"},{"name":"Container","category":"ui","path":"ui.tsx"}]
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcl/sdk",
|
3
|
-
"version": "7.0.0-
|
3
|
+
"version": "7.0.0-3252840030.commit-001810b",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/src/index.js",
|
6
6
|
"typings": "dist/index.d.ts",
|
@@ -27,8 +27,8 @@
|
|
27
27
|
"src/cli/**/*.js"
|
28
28
|
],
|
29
29
|
"dependencies": {
|
30
|
-
"@dcl/amd": "6.11.9-
|
31
|
-
"@dcl/build-ecs": "6.11.9-
|
30
|
+
"@dcl/amd": "6.11.9-3252840030.commit-001810b",
|
31
|
+
"@dcl/build-ecs": "6.11.9-3252840030.commit-001810b",
|
32
32
|
"@dcl/kernel": "1.0.0-2994874542.commit-c3ae489",
|
33
33
|
"@dcl/posix": "^1.0.4",
|
34
34
|
"@dcl/schemas": "4.8.0",
|
@@ -38,5 +38,5 @@
|
|
38
38
|
"ignore": "^5.1.8"
|
39
39
|
},
|
40
40
|
"minCliVersion": "3.10.2",
|
41
|
-
"commit": "
|
41
|
+
"commit": "001810bb0d4daec0e5271dfc6fc9bac338d13dcc"
|
42
42
|
}
|
package/types/ecs7/index.d.ts
CHANGED
@@ -6,6 +6,9 @@ declare const Animator: ComponentDefinition<ISchema<PBAnimator>, PBAnimator>;
|
|
6
6
|
/** @public */
|
7
7
|
declare const AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
|
8
8
|
|
9
|
+
/** @public */
|
10
|
+
declare const AudioStream: ComponentDefinition<ISchema<PBAudioStream>, PBAudioStream>;
|
11
|
+
|
9
12
|
declare const enum AvatarAnchorPointType {
|
10
13
|
AAPT_POSITION = 0,
|
11
14
|
AAPT_NAME_TAG = 1,
|
@@ -30,6 +33,11 @@ declare const AvatarShape: ComponentDefinition<ISchema<PBAvatarShape>, PBAvatarS
|
|
30
33
|
/** @public */
|
31
34
|
declare const Billboard: ComponentDefinition<ISchema<PBBillboard>, PBBillboard>;
|
32
35
|
|
36
|
+
declare const enum BillboardMode {
|
37
|
+
BM_ALL_AXES = 0,
|
38
|
+
BM_Y_AXE = 1
|
39
|
+
}
|
40
|
+
|
33
41
|
/**
|
34
42
|
* @public
|
35
43
|
*/
|
@@ -200,6 +208,8 @@ declare namespace Components {
|
|
200
208
|
/** @public */
|
201
209
|
const AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
|
202
210
|
/** @public */
|
211
|
+
const AudioStream: ComponentDefinition<ISchema<PBAudioStream>, PBAudioStream>;
|
212
|
+
/** @public */
|
203
213
|
const AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>, PBAvatarAttach>;
|
204
214
|
/** @public */
|
205
215
|
const AvatarModifierArea: ComponentDefinition<ISchema<PBAvatarModifierArea>, PBAvatarModifierArea>;
|
@@ -438,6 +448,7 @@ declare function defineSdkComponents(engine: PreEngine): {
|
|
438
448
|
MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, Partial<PBMeshCollider>>;
|
439
449
|
Animator: ComponentDefinition<ISchema<PBAnimator>, PBAnimator>;
|
440
450
|
AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
|
451
|
+
AudioStream: ComponentDefinition<ISchema<PBAudioStream>, PBAudioStream>;
|
441
452
|
AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>, PBAvatarAttach>;
|
442
453
|
AvatarModifierArea: ComponentDefinition<ISchema<PBAvatarModifierArea>, PBAvatarModifierArea>;
|
443
454
|
AvatarShape: ComponentDefinition<ISchema<PBAvatarShape>, PBAvatarShape>;
|
@@ -1833,6 +1844,13 @@ declare interface PBAudioSource {
|
|
1833
1844
|
audioClipUrl: string;
|
1834
1845
|
}
|
1835
1846
|
|
1847
|
+
declare interface PBAudioStream {
|
1848
|
+
playing?: boolean | undefined;
|
1849
|
+
/** default=1.0f */
|
1850
|
+
volume?: number | undefined;
|
1851
|
+
url: string;
|
1852
|
+
}
|
1853
|
+
|
1836
1854
|
declare interface PBAvatarAttach {
|
1837
1855
|
avatarId: string;
|
1838
1856
|
anchorPointId: AvatarAnchorPointType;
|
@@ -1875,12 +1893,10 @@ declare interface PBAvatarShape {
|
|
1875
1893
|
}
|
1876
1894
|
|
1877
1895
|
declare interface PBBillboard {
|
1878
|
-
/** default=
|
1879
|
-
|
1880
|
-
/** default=
|
1881
|
-
|
1882
|
-
/** default=true */
|
1883
|
-
z?: boolean | undefined;
|
1896
|
+
/** default=BM_ALL_AXES */
|
1897
|
+
billboardMode?: BillboardMode | undefined;
|
1898
|
+
/** default=false */
|
1899
|
+
oppositeDirection?: boolean | undefined;
|
1884
1900
|
}
|
1885
1901
|
|
1886
1902
|
declare interface PBCameraMode {
|
@@ -2057,18 +2073,13 @@ declare interface PBRaycastResult {
|
|
2057
2073
|
|
2058
2074
|
declare interface PBTextShape {
|
2059
2075
|
text: string;
|
2060
|
-
/**
|
2061
|
-
|
2062
|
-
font?: string | undefined;
|
2063
|
-
/** default=1.0f */
|
2064
|
-
opacity?: number | undefined;
|
2076
|
+
/** default=F_SANS_SERIF */
|
2077
|
+
font?: Font | undefined;
|
2065
2078
|
/** default=10 */
|
2066
2079
|
fontSize?: number | undefined;
|
2067
2080
|
fontAutoSize?: boolean | undefined;
|
2068
|
-
/** default=
|
2069
|
-
|
2070
|
-
/** default='center' */
|
2071
|
-
vTextAlign?: string | undefined;
|
2081
|
+
/** default=TAM_CENTER_CENTER */
|
2082
|
+
textAlign?: TextAlignMode | undefined;
|
2072
2083
|
/** default=1 */
|
2073
2084
|
width?: number | undefined;
|
2074
2085
|
/** default=1 */
|
@@ -2089,7 +2100,7 @@ declare interface PBTextShape {
|
|
2089
2100
|
/** default=(1.0,1.0,1.0) */
|
2090
2101
|
outlineColor?: Color3 | undefined;
|
2091
2102
|
/** default=(1.0,1.0,1.0) */
|
2092
|
-
textColor?:
|
2103
|
+
textColor?: Color4 | undefined;
|
2093
2104
|
}
|
2094
2105
|
|
2095
2106
|
declare interface PBUiBackground {
|
@@ -2614,9 +2625,15 @@ declare interface Spec {
|
|
2614
2625
|
declare type SystemFn = (dt: number) => void;
|
2615
2626
|
|
2616
2627
|
declare const enum TextAlignMode {
|
2617
|
-
|
2618
|
-
|
2619
|
-
|
2628
|
+
TAM_TOP_LEFT = 0,
|
2629
|
+
TAM_TOP_CENTER = 1,
|
2630
|
+
TAM_TOP_RIGHT = 2,
|
2631
|
+
TAM_MIDDLE_LEFT = 3,
|
2632
|
+
TAM_MIDDLE_CENTER = 4,
|
2633
|
+
TAM_MIDDLE_RIGHT = 5,
|
2634
|
+
TAM_BOTTOM_LEFT = 6,
|
2635
|
+
TAM_BOTTOM_CENTER = 7,
|
2636
|
+
TAM_BOTTOM_RIGHT = 8
|
2620
2637
|
}
|
2621
2638
|
|
2622
2639
|
/** @public */
|