angry-pixel 2.3.0 → 2.3.2
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/README.md +2 -2
- package/lib/index.cjs.js +1 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +22 -5
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -908,8 +908,8 @@ declare class EntityManager {
|
|
|
908
908
|
createEntity(): Entity;
|
|
909
909
|
/**
|
|
910
910
|
* Creates an Entity with the given components.\
|
|
911
|
-
*
|
|
912
|
-
* @param components A collection of component instances and component classes
|
|
911
|
+
* Component instances are cloned, so the collection of components can be reused to create multiple entities.
|
|
912
|
+
* @param components A collection of component instances and/or component classes
|
|
913
913
|
* @param parent The parent entity (optional)
|
|
914
914
|
* @return The created Entity
|
|
915
915
|
* @public
|
|
@@ -924,7 +924,7 @@ declare class EntityManager {
|
|
|
924
924
|
createEntity(components: (ComponentType | Component)[], parent?: Entity): Entity;
|
|
925
925
|
/**
|
|
926
926
|
* Creates an Entity from an Archetype template.\
|
|
927
|
-
*
|
|
927
|
+
* Component instances are cloned, so the archetype can be reused to create multiple entities.
|
|
928
928
|
* @param archetype The archetype to create the entity from
|
|
929
929
|
* @param parent The parent entity (optional)
|
|
930
930
|
* @return The created Entity
|
|
@@ -945,6 +945,7 @@ declare class EntityManager {
|
|
|
945
945
|
* ```
|
|
946
946
|
*/
|
|
947
947
|
createEntity(archetype: Archetype, parent?: Entity): Entity;
|
|
948
|
+
private createEntityFromArray;
|
|
948
949
|
/**
|
|
949
950
|
* Creates an Entity from an Archetype.
|
|
950
951
|
* @param archetype
|
|
@@ -954,13 +955,13 @@ declare class EntityManager {
|
|
|
954
955
|
*/
|
|
955
956
|
private createEntityFromArchetype;
|
|
956
957
|
/**
|
|
957
|
-
* Creates components from
|
|
958
|
+
* Creates components from a collection of component types and instances, and adds them to the entity.\
|
|
958
959
|
* @param components The components to create
|
|
959
960
|
* @param entity The entity to create the components for
|
|
960
961
|
* @param disabled If TRUE, each created component is disabled. Default is FALSE.
|
|
961
962
|
* @private
|
|
962
963
|
*/
|
|
963
|
-
private
|
|
964
|
+
private createComponentsForEntity;
|
|
964
965
|
/**
|
|
965
966
|
* Removes an Entity and all its Components
|
|
966
967
|
* @param entity The entity to remove
|
|
@@ -2441,6 +2442,12 @@ interface AudioPlayerOptions {
|
|
|
2441
2442
|
fixedToTimeScale: boolean;
|
|
2442
2443
|
/** TRUE If the audio source should loop. */
|
|
2443
2444
|
loop: boolean;
|
|
2445
|
+
/** Time mark (seconds) where looping starts. Only has effect when `loop` is TRUE and `loopEnd` is greater than zero. */
|
|
2446
|
+
loopStart: number;
|
|
2447
|
+
/** Time mark (seconds) where looping ends. When `loop` is TRUE and this is greater than zero, the audio loops between `loopStart` and `loopEnd`. */
|
|
2448
|
+
loopEnd: number;
|
|
2449
|
+
/** Time mark (seconds) where playback starts from when playing from a stopped state. Default is 0. */
|
|
2450
|
+
startAt: number;
|
|
2444
2451
|
/** The volume of the audio source. */
|
|
2445
2452
|
volume: number;
|
|
2446
2453
|
}
|
|
@@ -2470,10 +2477,18 @@ declare class AudioPlayer {
|
|
|
2470
2477
|
fixedToTimeScale: boolean;
|
|
2471
2478
|
/** TRUE If the audio source should loop. */
|
|
2472
2479
|
loop: boolean;
|
|
2480
|
+
/** Time mark (seconds) where looping starts. Only has effect when `loop` is TRUE and `loopEnd` is greater than zero. */
|
|
2481
|
+
loopStart: number;
|
|
2482
|
+
/** Time mark (seconds) where looping ends. When `loop` is TRUE and this is greater than zero, the audio loops between `loopStart` and `loopEnd`. */
|
|
2483
|
+
loopEnd: number;
|
|
2484
|
+
/** Time mark (seconds) where playback starts from when playing from a stopped state. Default is 0. */
|
|
2485
|
+
startAt: number;
|
|
2473
2486
|
/** READONLY, The current state of the audio source. */
|
|
2474
2487
|
state: "stopped" | "playing" | "paused";
|
|
2475
2488
|
/** The volume of the audio source. */
|
|
2476
2489
|
volume: number;
|
|
2490
|
+
/** READONLY, The current playback time mark of the audio source, expressed in seconds. */
|
|
2491
|
+
get currentTime(): number;
|
|
2477
2492
|
/** READONLY, TRUE If the audio source is playing. */
|
|
2478
2493
|
get playing(): boolean;
|
|
2479
2494
|
/** READONLY, TRUE If the audio source is paused. */
|
|
@@ -2490,6 +2505,8 @@ declare class AudioPlayer {
|
|
|
2490
2505
|
_startedAt: number;
|
|
2491
2506
|
/** @internal Offset (seconds) within the buffer at which the next play should resume from (used on pause) */
|
|
2492
2507
|
_pauseOffset: number;
|
|
2508
|
+
/** @internal Current playback time mark (seconds), updated each frame by the AudioPlayerSystem */
|
|
2509
|
+
_currentTime: number;
|
|
2493
2510
|
/** @internal */
|
|
2494
2511
|
_playAfterUserInput: boolean;
|
|
2495
2512
|
/** @internal */
|