angry-pixel 1.1.8 → 1.1.10
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 +4 -2
- package/lib/core/facades/AssetManagerFacade.d.ts +2 -1
- package/lib/core/managers/AssetManager.d.ts +12 -4
- 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 +2 -2
|
@@ -16,14 +16,16 @@ export declare class AudioPlayer extends EngineComponent {
|
|
|
16
16
|
private playOnStart;
|
|
17
17
|
private _playing;
|
|
18
18
|
private _paused;
|
|
19
|
-
protected init({ audioSource, loop, volume, playOnStart }?: AudioPlayerOptions): void;
|
|
20
|
-
protected start(): void;
|
|
21
19
|
set audioSource(audioSource: HTMLAudioElement);
|
|
22
20
|
get audioSource(): HTMLAudioElement;
|
|
23
21
|
set volume(volume: number);
|
|
24
22
|
get volume(): number;
|
|
25
23
|
set loop(loop: boolean);
|
|
26
24
|
get loop(): boolean;
|
|
25
|
+
get playing(): boolean;
|
|
26
|
+
get paused(): boolean;
|
|
27
|
+
protected init({ audioSource, loop, volume, playOnStart }?: AudioPlayerOptions): void;
|
|
28
|
+
protected start(): void;
|
|
27
29
|
playClip(audioSource: HTMLAudioElement, volume?: number): void;
|
|
28
30
|
play(): void;
|
|
29
31
|
stop(): void;
|
|
@@ -8,9 +8,10 @@ export declare class AssetManagerFacade {
|
|
|
8
8
|
static getAssetsLoaded(): boolean;
|
|
9
9
|
/**
|
|
10
10
|
* @param url The url of the image
|
|
11
|
+
* @param preloadTexture [optional] preload the texture for this image
|
|
11
12
|
* @returns The created image element
|
|
12
13
|
*/
|
|
13
|
-
static loadImage(url: string): HTMLImageElement;
|
|
14
|
+
static loadImage(url: string, preloadTexture?: boolean): HTMLImageElement;
|
|
14
15
|
/**
|
|
15
16
|
* @param url The url of the audio file
|
|
16
17
|
* @returns The created audio element
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IRenderManager } from "angry-pixel-2d-renderer";
|
|
1
2
|
export declare enum AssetType {
|
|
2
3
|
Image = "Image",
|
|
3
4
|
Audio = "Audio",
|
|
@@ -5,12 +6,19 @@ export declare enum AssetType {
|
|
|
5
6
|
}
|
|
6
7
|
export interface IAssetManager {
|
|
7
8
|
getAssetsLoaded(): boolean;
|
|
8
|
-
loadImage(url: string): HTMLImageElement;
|
|
9
|
+
loadImage(url: string, preloadTexture?: boolean): HTMLImageElement;
|
|
10
|
+
loadAudio(url: string): HTMLAudioElement;
|
|
11
|
+
loadFont(family: string, url: string): FontFace;
|
|
12
|
+
getImage(url: string): HTMLImageElement;
|
|
13
|
+
getAudio(url: string): HTMLAudioElement;
|
|
14
|
+
getFont(family: string): FontFace;
|
|
9
15
|
}
|
|
10
|
-
export declare class AssetManager {
|
|
11
|
-
private
|
|
16
|
+
export declare class AssetManager implements IAssetManager {
|
|
17
|
+
private readonly renderManager;
|
|
18
|
+
private readonly assets;
|
|
19
|
+
constructor(renderManager: IRenderManager);
|
|
12
20
|
getAssetsLoaded(): boolean;
|
|
13
|
-
loadImage(url: string): HTMLImageElement;
|
|
21
|
+
loadImage(url: string, preloadTexture?: boolean): HTMLImageElement;
|
|
14
22
|
loadAudio(url: string): HTMLAudioElement;
|
|
15
23
|
loadFont(family: string, url: string): FontFace;
|
|
16
24
|
getImage(url: string): HTMLImageElement;
|