@dcl/sdk 7.0.0-3379451953.commit-41b47e2 → 7.0.0-3380949689.commit-663e9f5

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.
@@ -1218,42 +1218,37 @@ declare const entitySymbol: unique symbol;
1218
1218
  */
1219
1219
  export declare const error: (message: string | Error, data?: any) => void;
1220
1220
 
1221
+ export declare type EventsSystem = typeof EventsSystem;
1222
+
1221
1223
  export declare namespace EventsSystem {
1222
1224
  export type Callback = (event: PBPointerEventsResult_PointerCommand) => void | Promise<void>;
1223
1225
  export type Options = {
1224
1226
  button?: InputAction;
1225
1227
  hoverText?: string;
1228
+ maxDistance?: number;
1226
1229
  };
1227
1230
  /**
1228
- * Remove the callback for onClick event
1229
- * @param entity Entity where the callback was attached
1230
- */
1231
- export function removeOnClick(entity: Entity): void;
1232
- /**
1231
+ * @public
1233
1232
  * Remove the callback for onPointerDown event
1234
1233
  * @param entity Entity where the callback was attached
1235
1234
  */
1236
1235
  export function removeOnPointerDown(entity: Entity): void;
1237
1236
  /**
1237
+ * @public
1238
1238
  * Remove the callback for onPointerUp event
1239
1239
  * @param entity Entity where the callback was attached
1240
1240
  */
1241
1241
  export function removeOnPointerUp(entity: Entity): void;
1242
1242
  /**
1243
- * Execute callback when the user clicks the entity.
1244
- * @param entity Entity to attach the callback
1245
- * @param cb Function to execute when onPointerDown fires
1246
- * @param opts Opts to trigger Feedback and Button
1247
- */
1248
- export function onClick(entity: Entity, cb: Callback, opts?: Options): void;
1249
- /**
1250
- * Execute callback when the user a the entity
1243
+ * @public
1244
+ * Execute callback when the user press the InputButton pointing at the entity
1251
1245
  * @param entity Entity to attach the callback
1252
1246
  * @param cb Function to execute when click fires
1253
1247
  * @param opts Opts to trigger Feedback and Button
1254
1248
  */
1255
1249
  export function onPointerDown(entity: Entity, cb: Callback, opts?: Options): void;
1256
1250
  /**
1251
+ * @public
1257
1252
  * Execute callback when the user releases the InputButton pointing at the entity
1258
1253
  * @param entity Entity to attach the callback
1259
1254
  * @param cb Function to execute when click fires
@@ -1430,40 +1425,24 @@ declare function IEnum<T>(type: ISchema<any>): ISchema<T>;
1430
1425
  */
1431
1426
  export declare type IInput = {
1432
1427
  /**
1433
- * Check if a click was emmited in the current tick for the input action.
1434
- * This is defined when an UP event is triggered with a previously DOWN state.
1435
- * @param inputAction - the input action to query
1436
- * @param entity - the entity to query, ignore for global events.
1437
- * @returns true if the entity was clicked in the last tick-update
1438
- */
1439
- wasJustClicked: (inputAction: InputAction, entity?: Entity) => boolean;
1440
- /**
1441
- * Check if a pointer event has been emited in the last tick-update.
1428
+ * @public
1429
+ * Check if a pointer event has been emitted in the last tick-update.
1442
1430
  * @param inputAction - the input action to query
1443
1431
  * @param pointerEventType - the pointer event type to query
1444
1432
  * @param entity - the entity to query, ignore for global
1445
- * @returns
1433
+ * @returns boolean
1446
1434
  */
1447
- wasInputJustActive: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => boolean;
1435
+ isTriggered: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => boolean;
1448
1436
  /**
1449
- * Check if an input action is in DOWN state.
1450
- * @param inputAction - the input action to query
1451
- * @returns true if the input action is being pressed
1452
- */
1453
- isActionDown: (inputAction: InputAction) => boolean;
1454
- /**
1455
- * Get the click info if a click was emmited in the current tick for the input action.
1456
- * This is defined when an UP event is triggered with a previously DOWN state.
1437
+ * @public
1438
+ * Check if an input action is currently being pressed.
1457
1439
  * @param inputAction - the input action to query
1458
- * @param entity - the entity to query, ignore for global events.
1459
- * @returns the click info or undefined if there is no command in the last tick-update
1440
+ * @returns boolean
1460
1441
  */
1461
- getClick: (inputAction: InputAction, entity?: Entity) => {
1462
- up: PBPointerEventsResult_PointerCommand;
1463
- down: PBPointerEventsResult_PointerCommand;
1464
- } | null;
1442
+ isPressed: (inputAction: InputAction) => boolean;
1465
1443
  /**
1466
- * Get the input command info if a pointer event has been emited in the last tick-update.
1444
+ * @public
1445
+ * Get the input command info if a pointer event has been emitted in the last tick-update.
1467
1446
  * @param inputAction - the input action to query
1468
1447
  * @param pointerEventType - the pointer event type to query
1469
1448
  * @param entity - the entity to query, ignore for global
@@ -1525,25 +1504,6 @@ export declare type ISchema<T = any> = {
1525
1504
  */
1526
1505
  export declare const log: (...a: any[]) => void;
1527
1506
 
1528
- /**
1529
- * @public
1530
- * Make the collision mask with some collider layers
1531
- * @param layers a array layers to be assigned
1532
- * @returns collisionMask to be used in the MeshCollider field
1533
- * @example
1534
- * ```ts
1535
- * // Physics and Pointer are the defaults
1536
- * MeshCollider.create(entity, {
1537
- * collisionMask: makeCollisionMask(
1538
- * ColliderLayer.Physics,
1539
- * ColliderLayer.Pointer
1540
- * ),
1541
- * box: {}
1542
- * })
1543
- * ```
1544
- */
1545
- export declare function makeCollisionMask(...layers: ColliderLayer[]): number;
1546
-
1547
1507
  /** @public */
1548
1508
  export declare const Material: ComponentDefinition<ISchema<PBMaterial>, PBMaterial>;
1549
1509