angry-pixel 1.1.9 → 1.1.11
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/lib/component/AudioPlayer.d.ts +30 -6
- package/lib/component/Button.d.ts +0 -1
- package/lib/core/Component.d.ts +1 -0
- package/lib/core/GameActor.d.ts +1 -0
- package/lib/core/GameObject.d.ts +1 -0
- package/lib/core/Scene.d.ts +1 -0
- package/lib/core/managers/GameObjectManager.d.ts +1 -1
- package/lib/core/managers/IterationManager.d.ts +2 -1
- package/lib/core/managers/SceneManager.d.ts +1 -0
- package/lib/index.cjs.js +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/lib/input/GamepadController.d.ts +1 -0
- package/lib/input/KeyboardController.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,32 +1,56 @@
|
|
|
1
1
|
import { EngineComponent } from "../core/Component";
|
|
2
2
|
import { InitOptions } from "../core/GameActor";
|
|
3
3
|
export interface AudioPlayerOptions extends InitOptions {
|
|
4
|
-
audioSource?: HTMLAudioElement;
|
|
5
4
|
volume?: number;
|
|
6
5
|
loop?: boolean;
|
|
7
|
-
playOnStart?: boolean;
|
|
8
6
|
}
|
|
9
7
|
export declare class AudioPlayer extends EngineComponent {
|
|
10
8
|
readonly allowMultiple: boolean;
|
|
11
9
|
private audioContext;
|
|
12
10
|
private tracks;
|
|
11
|
+
private audioSourceCache;
|
|
13
12
|
private _audioSource;
|
|
14
13
|
private _volume;
|
|
15
14
|
private _loop;
|
|
16
|
-
private playOnStart;
|
|
17
15
|
private _playing;
|
|
18
16
|
private _paused;
|
|
19
|
-
protected init({ audioSource, loop, volume, playOnStart }?: AudioPlayerOptions): void;
|
|
20
|
-
protected start(): void;
|
|
21
|
-
set audioSource(audioSource: HTMLAudioElement);
|
|
22
17
|
get audioSource(): HTMLAudioElement;
|
|
23
18
|
set volume(volume: number);
|
|
24
19
|
get volume(): number;
|
|
25
20
|
set loop(loop: boolean);
|
|
26
21
|
get loop(): boolean;
|
|
22
|
+
get playing(): boolean;
|
|
23
|
+
get paused(): boolean;
|
|
24
|
+
protected init({ loop, volume }?: AudioPlayerOptions): void;
|
|
25
|
+
/**
|
|
26
|
+
* Play once the given audio source
|
|
27
|
+
* @param audioSource
|
|
28
|
+
* @param volume optional
|
|
29
|
+
*/
|
|
27
30
|
playClip(audioSource: HTMLAudioElement, volume?: number): void;
|
|
31
|
+
/**
|
|
32
|
+
* Add a new audio source
|
|
33
|
+
* @param audioSource
|
|
34
|
+
*/
|
|
35
|
+
addAudioSource(audioSource: HTMLAudioElement, name?: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Load the given audio source (if there is other audio source playing, it will stop)
|
|
38
|
+
* @param audioSourceName
|
|
39
|
+
* @param loop optional
|
|
40
|
+
* @param volume optional
|
|
41
|
+
*/
|
|
42
|
+
loadAudioSource(audioSourceName: string, loop?: boolean, volume?: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* Play the loaded audio source
|
|
45
|
+
*/
|
|
28
46
|
play(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Stop playing the current audio source
|
|
49
|
+
*/
|
|
29
50
|
stop(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Plause the current audio source
|
|
53
|
+
*/
|
|
30
54
|
pause(): void;
|
|
31
55
|
private audioEventHandler;
|
|
32
56
|
private userInputEventHandler;
|
|
@@ -30,7 +30,6 @@ export declare class Button extends Component {
|
|
|
30
30
|
private scaled;
|
|
31
31
|
onClick: () => void;
|
|
32
32
|
onPressed: () => void;
|
|
33
|
-
onHover: () => void;
|
|
34
33
|
get offset(): Vector2;
|
|
35
34
|
set offset(offset: Vector2);
|
|
36
35
|
protected init({ type, height, radius, touchEnabled, width, offset }: ButtonOptions): void;
|
package/lib/core/Component.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export declare abstract class Component extends GameActor {
|
|
|
61
61
|
hasComponent(name: string): boolean;
|
|
62
62
|
removeComponent(component: Component): void;
|
|
63
63
|
protected _destroy(): void;
|
|
64
|
+
protected _stopGame(): void;
|
|
64
65
|
}
|
|
65
66
|
export declare abstract class EngineComponent extends Component {
|
|
66
67
|
protected readonly updateEvent: FrameEvent;
|
package/lib/core/GameActor.d.ts
CHANGED
package/lib/core/GameObject.d.ts
CHANGED
package/lib/core/Scene.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class GameObjectManager {
|
|
|
14
14
|
findGameObjectByParent<T extends GameObject>(parent: GameObject, gameObjectClass: GameObjectClass<T>): T;
|
|
15
15
|
findGameObjectByParent<T extends GameObject>(parent: GameObject, name: string): T;
|
|
16
16
|
findGameObjectsByTag<T extends GameObject>(tag: string): T[];
|
|
17
|
-
destroyAllGameObjects(): void;
|
|
17
|
+
destroyAllGameObjects(ignoreKeep?: boolean): void;
|
|
18
18
|
destroyGameObject(gameObject: GameObject): void;
|
|
19
19
|
private destroy;
|
|
20
20
|
private destroyChildren;
|