@dcl/ecs 7.1.4-4491693391.commit-569ecab → 7.1.4-4495128859.commit-9f954df

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.
Files changed (39) hide show
  1. package/dist/components/generated/pb/decentraland/sdk/components/animator.gen.d.ts +17 -3
  2. package/dist/components/generated/pb/decentraland/sdk/components/audio_source.gen.d.ts +16 -2
  3. package/dist/components/generated/pb/decentraland/sdk/components/audio_stream.gen.d.ts +8 -1
  4. package/dist/components/generated/pb/decentraland/sdk/components/avatar_attach.gen.d.ts +13 -1
  5. package/dist/components/generated/pb/decentraland/sdk/components/avatar_attach.gen.js +1 -0
  6. package/dist/components/generated/pb/decentraland/sdk/components/avatar_modifier_area.gen.d.ts +20 -0
  7. package/dist/components/generated/pb/decentraland/sdk/components/avatar_modifier_area.gen.js +3 -0
  8. package/dist/components/generated/pb/decentraland/sdk/components/avatar_shape.gen.d.ts +29 -14
  9. package/dist/components/generated/pb/decentraland/sdk/components/billboard.gen.d.ts +11 -1
  10. package/dist/components/generated/pb/decentraland/sdk/components/billboard.gen.js +2 -0
  11. package/dist/components/generated/pb/decentraland/sdk/components/camera_mode.gen.d.ts +5 -0
  12. package/dist/components/generated/pb/decentraland/sdk/components/camera_mode_area.gen.d.ts +15 -0
  13. package/dist/components/generated/pb/decentraland/sdk/components/common/camera_type.gen.d.ts +3 -1
  14. package/dist/components/generated/pb/decentraland/sdk/components/common/camera_type.gen.js +2 -0
  15. package/dist/components/generated/pb/decentraland/sdk/components/common/input_action.gen.d.ts +10 -0
  16. package/dist/components/generated/pb/decentraland/sdk/components/common/input_action.gen.js +11 -0
  17. package/dist/components/generated/pb/decentraland/sdk/components/common/raycast_hit.gen.d.ts +21 -0
  18. package/dist/components/generated/pb/decentraland/sdk/components/common/raycast_hit.gen.js +82 -0
  19. package/dist/components/generated/pb/decentraland/sdk/components/gltf_container.gen.d.ts +7 -1
  20. package/dist/components/generated/pb/decentraland/sdk/components/mesh_collider.gen.d.ts +37 -4
  21. package/dist/components/generated/pb/decentraland/sdk/components/mesh_collider.gen.js +19 -0
  22. package/dist/components/generated/pb/decentraland/sdk/components/mesh_renderer.gen.d.ts +18 -2
  23. package/dist/components/generated/pb/decentraland/sdk/components/nft_shape.gen.d.ts +13 -2
  24. package/dist/components/generated/pb/decentraland/sdk/components/nft_shape.gen.js +1 -0
  25. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events.gen.d.ts +21 -12
  26. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events.gen.js +0 -10
  27. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events_result.gen.d.ts +2 -3
  28. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events_result.gen.js +3 -3
  29. package/dist/components/generated/pb/decentraland/sdk/components/pointer_lock.gen.d.ts +5 -0
  30. package/dist/components/generated/pb/decentraland/sdk/components/raycast.gen.d.ts +41 -3
  31. package/dist/components/generated/pb/decentraland/sdk/components/raycast.gen.js +56 -7
  32. package/dist/components/generated/pb/decentraland/sdk/components/raycast_result.gen.d.ts +14 -15
  33. package/dist/components/generated/pb/decentraland/sdk/components/raycast_result.gen.js +8 -111
  34. package/dist/components/generated/pb/decentraland/sdk/components/text_shape.gen.d.ts +29 -11
  35. package/dist/components/generated/pb/decentraland/sdk/components/ui_text.gen.d.ts +5 -4
  36. package/dist/components/generated/types.gen.d.ts +1 -0
  37. package/dist/components/generated/types.gen.js +2 -0
  38. package/dist/engine/input.d.ts +1 -1
  39. package/package.json +20 -26
@@ -1,4 +1,5 @@
1
1
  import { Color3 } from "../../common/colors.gen";
2
+ /** NftFrameType is a predefined framing style for the image. */
2
3
  /**
3
4
  * @public
4
5
  */
@@ -27,13 +28,23 @@ export declare const enum NftFrameType {
27
28
  NFT_CANVAS = 21,
28
29
  NFT_NONE = 22
29
30
  }
31
+ /**
32
+ * The NftShape component renders a framed picture from an NFT. It supports PNG, JPEG and GIF files.
33
+ *
34
+ * The `src` field is the URI of the NFT, which includes its parent contract and index, using
35
+ * the `https:` or `ethereum:` schemes.
36
+ *
37
+ * The picture frame can have several different styles, plus a background color for images that have
38
+ * transparent pixels.
39
+ */
30
40
  /**
31
41
  * @public
32
42
  */
33
43
  export interface PBNftShape {
44
+ /** the URI of the NFT */
34
45
  src: string;
35
- /** default = PictureFrameStyle.Classic */
46
+ /** the frame style (default NFT_CLASSIC) */
36
47
  style?: NftFrameType | undefined;
37
- /** default = decentraland.common.Color3(0.6404918, 0.611472, 0.8584906) */
48
+ /** RGB background (default [0.6404918, 0.611472, 0.8584906]) */
38
49
  color?: Color3 | undefined;
39
50
  }
@@ -2,6 +2,7 @@
2
2
  import _m0 from "protobufjs/minimal";
3
3
  import { Color3 } from "../../common/colors.gen";
4
4
  const protobufPackageSarasa = "decentraland.sdk.components";
5
+ /** NftFrameType is a predefined framing style for the image. */
5
6
  /**
6
7
  * @public
7
8
  */
@@ -1,36 +1,45 @@
1
- import { InputAction } from "./common/input_action.gen";
1
+ import { InputAction, PointerEventType } from "./common/input_action.gen";
2
2
  /**
3
- * @public
3
+ * PointerEvents adds configurable pointer-based interactions to the attached Entity.
4
+ *
5
+ * Events that match the criteria defined in the PointerEvents structure are reported back to the
6
+ * Entity via the PointerEventsResult component.
7
+ *
8
+ * Some examples of events that can be detected:
9
+ * - Pointer hovering over the Entity.
10
+ * - Held mouse button released over the Entity.
11
+ * - Controller button pressed while targeting the Entity.
12
+ * - Key pressed while targeting the Entity, but only in close range.
13
+ *
14
+ * It also supports simple visual feedback when interactions occur, by showing floating text.
15
+ * More sophisticated feedback requires the use of other components.
4
16
  */
5
- export declare const enum PointerEventType {
6
- PET_UP = 0,
7
- PET_DOWN = 1,
8
- PET_HOVER_ENTER = 2,
9
- PET_HOVER_LEAVE = 3
10
- }
11
17
  /**
12
18
  * @public
13
19
  */
14
20
  export interface PBPointerEvents {
21
+ /** the list of relevant events to detect */
15
22
  pointerEvents: PBPointerEvents_Entry[];
16
23
  }
17
24
  /**
18
25
  * @public
19
26
  */
20
27
  export interface PBPointerEvents_Info {
21
- /** default=InputAction.ANY */
28
+ /** key/button in use (default IA_ANY) */
22
29
  button?: InputAction | undefined;
23
- /** default='Interact' */
30
+ /** feedback on hover (default 'Interact') */
24
31
  hoverText?: string | undefined;
25
- /** default=10 */
32
+ /** range of interaction (default 10) */
26
33
  maxDistance?: number | undefined;
27
- /** default=true */
34
+ /** enable or disable hover text (default true) */
28
35
  showFeedback?: boolean | undefined;
29
36
  }
30
37
  /**
31
38
  * @public
32
39
  */
33
40
  export interface PBPointerEvents_Entry {
41
+ /** the kind of interaction to detect */
34
42
  eventType: PointerEventType;
43
+ /** additional configuration for this detection */
35
44
  eventInfo: PBPointerEvents_Info | undefined;
36
45
  }
@@ -1,16 +1,6 @@
1
1
  /* eslint-disable */
2
2
  import _m0 from "protobufjs/minimal";
3
3
  const protobufPackageSarasa = "decentraland.sdk.components";
4
- /**
5
- * @public
6
- */
7
- export var PointerEventType;
8
- (function (PointerEventType) {
9
- PointerEventType[PointerEventType["PET_UP"] = 0] = "PET_UP";
10
- PointerEventType[PointerEventType["PET_DOWN"] = 1] = "PET_DOWN";
11
- PointerEventType[PointerEventType["PET_HOVER_ENTER"] = 2] = "PET_HOVER_ENTER";
12
- PointerEventType[PointerEventType["PET_HOVER_LEAVE"] = 3] = "PET_HOVER_LEAVE";
13
- })(PointerEventType || (PointerEventType = {}));
14
4
  function createBasePBPointerEvents() {
15
5
  return { pointerEvents: [] };
16
6
  }
@@ -1,6 +1,5 @@
1
- import { InputAction } from "./common/input_action.gen";
2
- import { PointerEventType } from "./pointer_events.gen";
3
- import { RaycastHit } from "./raycast_result.gen";
1
+ import { InputAction, PointerEventType } from "./common/input_action.gen";
2
+ import { RaycastHit } from "./common/raycast_hit.gen";
4
3
  /** renderer append a new object of this in each command, there can be many commands per frames */
5
4
  /**
6
5
  * @public
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  import _m0 from "protobufjs/minimal";
3
- import { RaycastHit } from "./raycast_result.gen";
3
+ import { RaycastHit } from "./common/raycast_hit.gen";
4
4
  const protobufPackageSarasa = "decentraland.sdk.components";
5
5
  function createBasePBPointerEventsResult() {
6
6
  return { button: 0, hit: undefined, state: 0, timestamp: 0, analog: undefined };
@@ -23,7 +23,7 @@ export const PBPointerEventsResult = {
23
23
  writer.uint32(32).int32(message.state);
24
24
  }
25
25
  if (message.timestamp !== 0) {
26
- writer.uint32(40).int32(message.timestamp);
26
+ writer.uint32(40).uint32(message.timestamp);
27
27
  }
28
28
  if (message.analog !== undefined) {
29
29
  writer.uint32(53).float(message.analog);
@@ -47,7 +47,7 @@ export const PBPointerEventsResult = {
47
47
  message.state = reader.int32();
48
48
  break;
49
49
  case 5:
50
- message.timestamp = reader.int32();
50
+ message.timestamp = reader.uint32();
51
51
  break;
52
52
  case 6:
53
53
  message.analog = reader.float();
@@ -1,6 +1,11 @@
1
+ /**
2
+ * PointerLock indicates whether the mouse pointer is automatically following the camera’s point of
3
+ * focus (locked), or can move freely on the screen (unlocked).
4
+ */
1
5
  /**
2
6
  * @public
3
7
  */
4
8
  export interface PBPointerLock {
9
+ /** whether the pointer is locked */
5
10
  isPointerLocked: boolean;
6
11
  }
@@ -1,17 +1,55 @@
1
1
  import { Vector3 } from "../../common/vectors.gen";
2
+ /** RaycastQueryType indicates whether the ray should stop on the first collition, or continue. */
2
3
  /**
3
4
  * @public
4
5
  */
5
6
  export declare const enum RaycastQueryType {
7
+ /** RQT_HIT_FIRST - Pick the first (not necessarily the closest) hit within the range */
6
8
  RQT_HIT_FIRST = 0,
7
- RQT_QUERY_ALL = 1
9
+ /** RQT_QUERY_ALL - Pick all hits within the range */
10
+ RQT_QUERY_ALL = 1,
11
+ /** RQT_NONE - Do not perform the raycast, only set the raycast result with empty hits */
12
+ RQT_NONE = 2
8
13
  }
14
+ /**
15
+ * The PBRaycast component and PBRaycastResult are defined in https://adr.decentraland.org/adr/ADR-200
16
+ *
17
+ * The Raycast component allows scenes to request raycasting from the game engine. The results will
18
+ * be available in a RaycastResult component set later on the same Entity.
19
+ */
9
20
  /**
10
21
  * @public
11
22
  */
12
23
  export interface PBRaycast {
13
- origin: Vector3 | undefined;
14
- direction: Vector3 | undefined;
24
+ /** Correlation ID, defined by the scene and used internally by the scene */
25
+ timestamp?: number | undefined;
26
+ /**
27
+ * How much to offset the starting point of the ray, relative to the entity's transform.
28
+ * Defaults to vec3(0,0,0)
29
+ */
30
+ originOffset?: Vector3 | undefined;
31
+ direction?: {
32
+ $case: "localDirection";
33
+ localDirection: Vector3;
34
+ } | {
35
+ $case: "globalDirection";
36
+ globalDirection: Vector3;
37
+ } | {
38
+ $case: "globalTarget";
39
+ globalTarget: Vector3;
40
+ } | {
41
+ $case: "targetEntity";
42
+ targetEntity: number;
43
+ };
44
+ /** Maximum length of the ray in virtual meters (global space) */
15
45
  maxDistance: number;
46
+ /** the RaycastQueryType behavior */
16
47
  queryType: RaycastQueryType;
48
+ /**
49
+ * Indicates the renderer to perform the raycast on every scene tick (ADR-148),
50
+ * otherwise it will be performed only once, defaults to false
51
+ */
52
+ continuous?: boolean | undefined;
53
+ /** Collision mask, by default all bits are 1 (0xFFFF_FFFF) */
54
+ collisionMask?: number | undefined;
17
55
  }
@@ -2,16 +2,29 @@
2
2
  import _m0 from "protobufjs/minimal";
3
3
  import { Vector3 } from "../../common/vectors.gen";
4
4
  const protobufPackageSarasa = "decentraland.sdk.components";
5
+ /** RaycastQueryType indicates whether the ray should stop on the first collition, or continue. */
5
6
  /**
6
7
  * @public
7
8
  */
8
9
  export var RaycastQueryType;
9
10
  (function (RaycastQueryType) {
11
+ /** RQT_HIT_FIRST - Pick the first (not necessarily the closest) hit within the range */
10
12
  RaycastQueryType[RaycastQueryType["RQT_HIT_FIRST"] = 0] = "RQT_HIT_FIRST";
13
+ /** RQT_QUERY_ALL - Pick all hits within the range */
11
14
  RaycastQueryType[RaycastQueryType["RQT_QUERY_ALL"] = 1] = "RQT_QUERY_ALL";
15
+ /** RQT_NONE - Do not perform the raycast, only set the raycast result with empty hits */
16
+ RaycastQueryType[RaycastQueryType["RQT_NONE"] = 2] = "RQT_NONE";
12
17
  })(RaycastQueryType || (RaycastQueryType = {}));
13
18
  function createBasePBRaycast() {
14
- return { origin: undefined, direction: undefined, maxDistance: 0, queryType: 0 };
19
+ return {
20
+ timestamp: undefined,
21
+ originOffset: undefined,
22
+ direction: undefined,
23
+ maxDistance: 0,
24
+ queryType: 0,
25
+ continuous: undefined,
26
+ collisionMask: undefined,
27
+ };
15
28
  }
16
29
  /**
17
30
  * @public
@@ -21,11 +34,23 @@ function createBasePBRaycast() {
21
34
  */
22
35
  export const PBRaycast = {
23
36
  encode(message, writer = _m0.Writer.create()) {
24
- if (message.origin !== undefined) {
25
- Vector3.encode(message.origin, writer.uint32(18).fork()).ldelim();
37
+ if (message.timestamp !== undefined) {
38
+ writer.uint32(8).uint32(message.timestamp);
26
39
  }
27
- if (message.direction !== undefined) {
28
- Vector3.encode(message.direction, writer.uint32(26).fork()).ldelim();
40
+ if (message.originOffset !== undefined) {
41
+ Vector3.encode(message.originOffset, writer.uint32(18).fork()).ldelim();
42
+ }
43
+ if (message.direction?.$case === "localDirection") {
44
+ Vector3.encode(message.direction.localDirection, writer.uint32(50).fork()).ldelim();
45
+ }
46
+ if (message.direction?.$case === "globalDirection") {
47
+ Vector3.encode(message.direction.globalDirection, writer.uint32(26).fork()).ldelim();
48
+ }
49
+ if (message.direction?.$case === "globalTarget") {
50
+ Vector3.encode(message.direction.globalTarget, writer.uint32(58).fork()).ldelim();
51
+ }
52
+ if (message.direction?.$case === "targetEntity") {
53
+ writer.uint32(80).uint32(message.direction.targetEntity);
29
54
  }
30
55
  if (message.maxDistance !== 0) {
31
56
  writer.uint32(37).float(message.maxDistance);
@@ -33,6 +58,12 @@ export const PBRaycast = {
33
58
  if (message.queryType !== 0) {
34
59
  writer.uint32(40).int32(message.queryType);
35
60
  }
61
+ if (message.continuous !== undefined) {
62
+ writer.uint32(64).bool(message.continuous);
63
+ }
64
+ if (message.collisionMask !== undefined) {
65
+ writer.uint32(72).uint32(message.collisionMask);
66
+ }
36
67
  return writer;
37
68
  },
38
69
  decode(input, length) {
@@ -42,11 +73,23 @@ export const PBRaycast = {
42
73
  while (reader.pos < end) {
43
74
  const tag = reader.uint32();
44
75
  switch (tag >>> 3) {
76
+ case 1:
77
+ message.timestamp = reader.uint32();
78
+ break;
45
79
  case 2:
46
- message.origin = Vector3.decode(reader, reader.uint32());
80
+ message.originOffset = Vector3.decode(reader, reader.uint32());
81
+ break;
82
+ case 6:
83
+ message.direction = { $case: "localDirection", localDirection: Vector3.decode(reader, reader.uint32()) };
47
84
  break;
48
85
  case 3:
49
- message.direction = Vector3.decode(reader, reader.uint32());
86
+ message.direction = { $case: "globalDirection", globalDirection: Vector3.decode(reader, reader.uint32()) };
87
+ break;
88
+ case 7:
89
+ message.direction = { $case: "globalTarget", globalTarget: Vector3.decode(reader, reader.uint32()) };
90
+ break;
91
+ case 10:
92
+ message.direction = { $case: "targetEntity", targetEntity: reader.uint32() };
50
93
  break;
51
94
  case 4:
52
95
  message.maxDistance = reader.float();
@@ -54,6 +97,12 @@ export const PBRaycast = {
54
97
  case 5:
55
98
  message.queryType = reader.int32();
56
99
  break;
100
+ case 8:
101
+ message.continuous = reader.bool();
102
+ break;
103
+ case 9:
104
+ message.collisionMask = reader.uint32();
105
+ break;
57
106
  default:
58
107
  reader.skipType(tag & 7);
59
108
  break;
@@ -1,23 +1,22 @@
1
1
  import { Vector3 } from "../../common/vectors.gen";
2
+ import { RaycastHit } from "./common/raycast_hit.gen";
2
3
  /**
3
- * @public
4
+ * The PBRaycast component and PBRaycastResult are defined in https://adr.decentraland.org/adr/ADR-200
5
+ *
6
+ * The RaycastResult component is added to an Entity when the results of a previously attached
7
+ * Raycast component are available. It contains information about the ray and any objects it
8
+ * collided with.
4
9
  */
5
- export interface PBRaycastResult {
6
- timestamp: number;
7
- origin: Vector3 | undefined;
8
- direction: Vector3 | undefined;
9
- hits: RaycastHit[];
10
- }
11
- /** Position will be relative to the scene */
12
10
  /**
13
11
  * @public
14
12
  */
15
- export interface RaycastHit {
16
- position: Vector3 | undefined;
17
- origin: Vector3 | undefined;
13
+ export interface PBRaycastResult {
14
+ /** timestamp is a correlation id, copied from the PBRaycast */
15
+ timestamp?: number | undefined;
16
+ /** the starting point of the ray in global coordinates */
17
+ globalOrigin: Vector3 | undefined;
18
+ /** the direction vector of the ray in global coordinates */
18
19
  direction: Vector3 | undefined;
19
- normalHit: Vector3 | undefined;
20
- length: number;
21
- meshName?: string | undefined;
22
- entityId?: number | undefined;
20
+ /** zero or more hits */
21
+ hits: RaycastHit[];
23
22
  }
@@ -1,10 +1,10 @@
1
1
  /* eslint-disable */
2
- import Long from "long";
3
2
  import _m0 from "protobufjs/minimal";
4
3
  import { Vector3 } from "../../common/vectors.gen";
4
+ import { RaycastHit } from "./common/raycast_hit.gen";
5
5
  const protobufPackageSarasa = "decentraland.sdk.components";
6
6
  function createBasePBRaycastResult() {
7
- return { timestamp: 0, origin: undefined, direction: undefined, hits: [] };
7
+ return { timestamp: undefined, globalOrigin: undefined, direction: undefined, hits: [] };
8
8
  }
9
9
  /**
10
10
  * @public
@@ -14,11 +14,11 @@ function createBasePBRaycastResult() {
14
14
  */
15
15
  export const PBRaycastResult = {
16
16
  encode(message, writer = _m0.Writer.create()) {
17
- if (message.timestamp !== 0) {
18
- writer.uint32(8).int32(message.timestamp);
17
+ if (message.timestamp !== undefined) {
18
+ writer.uint32(8).uint32(message.timestamp);
19
19
  }
20
- if (message.origin !== undefined) {
21
- Vector3.encode(message.origin, writer.uint32(18).fork()).ldelim();
20
+ if (message.globalOrigin !== undefined) {
21
+ Vector3.encode(message.globalOrigin, writer.uint32(18).fork()).ldelim();
22
22
  }
23
23
  if (message.direction !== undefined) {
24
24
  Vector3.encode(message.direction, writer.uint32(26).fork()).ldelim();
@@ -36,10 +36,10 @@ export const PBRaycastResult = {
36
36
  const tag = reader.uint32();
37
37
  switch (tag >>> 3) {
38
38
  case 1:
39
- message.timestamp = reader.int32();
39
+ message.timestamp = reader.uint32();
40
40
  break;
41
41
  case 2:
42
- message.origin = Vector3.decode(reader, reader.uint32());
42
+ message.globalOrigin = Vector3.decode(reader, reader.uint32());
43
43
  break;
44
44
  case 3:
45
45
  message.direction = Vector3.decode(reader, reader.uint32());
@@ -55,106 +55,3 @@ export const PBRaycastResult = {
55
55
  return message;
56
56
  },
57
57
  };
58
- function createBaseRaycastHit() {
59
- return {
60
- position: undefined,
61
- origin: undefined,
62
- direction: undefined,
63
- normalHit: undefined,
64
- length: 0,
65
- meshName: undefined,
66
- entityId: undefined,
67
- };
68
- }
69
- /**
70
- * @public
71
- */
72
- /**
73
- * @internal
74
- */
75
- export const RaycastHit = {
76
- encode(message, writer = _m0.Writer.create()) {
77
- if (message.position !== undefined) {
78
- Vector3.encode(message.position, writer.uint32(10).fork()).ldelim();
79
- }
80
- if (message.origin !== undefined) {
81
- Vector3.encode(message.origin, writer.uint32(18).fork()).ldelim();
82
- }
83
- if (message.direction !== undefined) {
84
- Vector3.encode(message.direction, writer.uint32(26).fork()).ldelim();
85
- }
86
- if (message.normalHit !== undefined) {
87
- Vector3.encode(message.normalHit, writer.uint32(34).fork()).ldelim();
88
- }
89
- if (message.length !== 0) {
90
- writer.uint32(45).float(message.length);
91
- }
92
- if (message.meshName !== undefined) {
93
- writer.uint32(50).string(message.meshName);
94
- }
95
- if (message.entityId !== undefined) {
96
- writer.uint32(56).int64(message.entityId);
97
- }
98
- return writer;
99
- },
100
- decode(input, length) {
101
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
102
- let end = length === undefined ? reader.len : reader.pos + length;
103
- const message = createBaseRaycastHit();
104
- while (reader.pos < end) {
105
- const tag = reader.uint32();
106
- switch (tag >>> 3) {
107
- case 1:
108
- message.position = Vector3.decode(reader, reader.uint32());
109
- break;
110
- case 2:
111
- message.origin = Vector3.decode(reader, reader.uint32());
112
- break;
113
- case 3:
114
- message.direction = Vector3.decode(reader, reader.uint32());
115
- break;
116
- case 4:
117
- message.normalHit = Vector3.decode(reader, reader.uint32());
118
- break;
119
- case 5:
120
- message.length = reader.float();
121
- break;
122
- case 6:
123
- message.meshName = reader.string();
124
- break;
125
- case 7:
126
- message.entityId = longToNumber(reader.int64());
127
- break;
128
- default:
129
- reader.skipType(tag & 7);
130
- break;
131
- }
132
- }
133
- return message;
134
- },
135
- };
136
- var tsProtoGlobalThis = (() => {
137
- if (typeof globalThis !== "undefined") {
138
- return globalThis;
139
- }
140
- if (typeof self !== "undefined") {
141
- return self;
142
- }
143
- if (typeof window !== "undefined") {
144
- return window;
145
- }
146
- if (typeof global !== "undefined") {
147
- return global;
148
- }
149
- throw "Unable to locate global object";
150
- })();
151
- function longToNumber(long) {
152
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
153
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
154
- }
155
- return long.toNumber();
156
- }
157
- if (_m0.util.Long !== Long) {
158
- _m0.util.Long = Long;
159
- _m0.configure();
160
- }
@@ -1,39 +1,57 @@
1
1
  import { Color3, Color4 } from "../../common/colors.gen";
2
2
  import { Font, TextAlignMode } from "./common/texts.gen";
3
+ /**
4
+ * The TextShape component renders customizable floating text.
5
+ *
6
+ * The position and rotation of the text are defined by the Entity's Transform, while its size
7
+ * can either scale with the Transform or be fixed by a font size.
8
+ *
9
+ * Several options can be configured, including color, padding, line spacing and drop shadows.
10
+ */
3
11
  /**
4
12
  * @public
5
13
  */
6
14
  export interface PBTextShape {
15
+ /** the content */
7
16
  text: string;
8
- /** default=F_SANS_SERIF */
17
+ /** the font (default F_SANS_SERIF) */
9
18
  font?: Font | undefined;
10
- /** default=10 */
19
+ /** the font size (default 10) */
11
20
  fontSize?: number | undefined;
21
+ /** override `font_size` to automatically fit in `width`/`height` */
12
22
  fontAutoSize?: boolean | undefined;
13
- /** default=TAM_CENTER_CENTER */
23
+ /** X and Y alignment (default TAM_CENTER_CENTER) */
14
24
  textAlign?: TextAlignMode | undefined;
15
- /** default=1 */
25
+ /** available horizontal space (default 1) */
16
26
  width?: number | undefined;
17
- /** default=1 */
27
+ /** available vertical space (default 1) */
18
28
  height?: number | undefined;
29
+ /** distance from text to top border (default 0) */
19
30
  paddingTop?: number | undefined;
31
+ /** distance from text to right border (default 0) */
20
32
  paddingRight?: number | undefined;
33
+ /** distance from text to bottom border (default 0) */
21
34
  paddingBottom?: number | undefined;
35
+ /** distance from text to left border (default 0) */
22
36
  paddingLeft?: number | undefined;
23
- /** The amount of additional spacing to add between each lines of text. */
37
+ /** extra distance between lines (default 0) */
24
38
  lineSpacing?: number | undefined;
25
- /** Allows control over how many lines of text are displayed. */
39
+ /** maximum number of lines to display */
26
40
  lineCount?: number | undefined;
27
- /** Enables text wrapping */
41
+ /** wrap text when the border is reached (default false) */
28
42
  textWrapping?: boolean | undefined;
43
+ /** blurriness of the drop shadow (default 0) */
29
44
  shadowBlur?: number | undefined;
45
+ /** horizontal length of the shadow (default 0) */
30
46
  shadowOffsetX?: number | undefined;
47
+ /** vertical length of the shadow (default 0) */
31
48
  shadowOffsetY?: number | undefined;
49
+ /** width of the stroke outlining each letter (default 0) */
32
50
  outlineWidth?: number | undefined;
33
- /** default=(1.0,1.0,1.0) */
51
+ /** drop shadow color (default [1.0, 1.0, 1.0]) */
34
52
  shadowColor?: Color3 | undefined;
35
- /** default=(1.0,1.0,1.0) */
53
+ /** outline stroke color (default [1.0, 1.0, 1.0]) */
36
54
  outlineColor?: Color3 | undefined;
37
- /** default=(1.0,1.0,1.0) */
55
+ /** text color (default [1.0, 1.0, 1.0]) */
38
56
  textColor?: Color4 | undefined;
39
57
  }
@@ -4,13 +4,14 @@ import { Font, TextAlignMode } from "./common/texts.gen";
4
4
  * @public
5
5
  */
6
6
  export interface PBUiText {
7
+ /** the text content */
7
8
  value: string;
8
- /** default=(1.0,1.0,1.0,1.0) */
9
+ /** RGBA color (default: opaque white) */
9
10
  color?: Color4 | undefined;
10
- /** default='center' */
11
+ /** alignment within the bounds (default: center) */
11
12
  textAlign?: TextAlignMode | undefined;
12
- /** default=0 */
13
+ /** font for the text (default: sans-serif) */
13
14
  font?: Font | undefined;
14
- /** default=10 */
15
+ /** size of the text (default: 10) */
15
16
  fontSize?: number | undefined;
16
17
  }
@@ -2,6 +2,7 @@ export type { Position as PBPosition, Vector2 as PBVector2, Vector3 as PBVector3
2
2
  export type { Color3 as PBColor3, Color4 as PBColor4 } from './pb/decentraland/common/colors.gen';
3
3
  export * from './pb/decentraland/sdk/components/common/camera_type.gen';
4
4
  export * from './pb/decentraland/sdk/components/common/input_action.gen';
5
+ export * from './pb/decentraland/sdk/components/common/raycast_hit.gen';
5
6
  export * from './pb/decentraland/sdk/components/common/texts.gen';
6
7
  export * from './pb/decentraland/common/border_rect.gen';
7
8
  export * from './pb/decentraland/common/texture.gen';
@@ -2,6 +2,8 @@ export * from './pb/decentraland/sdk/components/common/camera_type.gen';
2
2
  // export { PbCameraType }
3
3
  export * from './pb/decentraland/sdk/components/common/input_action.gen';
4
4
  // export { PbInputAction }
5
+ export * from './pb/decentraland/sdk/components/common/raycast_hit.gen';
6
+ // export { PbRaycastHit }
5
7
  export * from './pb/decentraland/sdk/components/common/texts.gen';
6
8
  // export { PbTexts }
7
9
  export * from './pb/decentraland/common/border_rect.gen';
@@ -1,5 +1,5 @@
1
1
  import { InputAction } from '../components/generated/pb/decentraland/sdk/components/common/input_action.gen';
2
- import { PointerEventType } from '../components/generated/pb/decentraland/sdk/components/pointer_events.gen';
2
+ import { PointerEventType } from '../components/generated/pb/decentraland/sdk/components/common/input_action.gen';
3
3
  import { PBPointerEventsResult } from '../components/generated/pb/decentraland/sdk/components/pointer_events_result.gen';
4
4
  import { Entity } from './entity';
5
5
  /**