angry-pixel 1.0.8 → 1.0.9
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/Animation.d.ts +2 -2
- package/lib/component/Animator.d.ts +1 -3
- package/lib/component/ComponentTypes.d.ts +1 -0
- package/lib/component/RigidBody.d.ts +0 -3
- package/lib/component/Transform.d.ts +2 -0
- package/lib/component/renderingComponent/MaskRenderer.d.ts +29 -0
- package/lib/core/GameObject.d.ts +1 -0
- package/lib/core/Scene.d.ts +0 -4
- package/lib/core/facades/AssetManagerFacade.d.ts +2 -2
- package/lib/core/facades/GameObjectManagerFacade.d.ts +0 -4
- package/lib/core/managers/AssetManager.d.ts +2 -3
- package/lib/index.cjs.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/lib/input/GamepadController.d.ts +9 -1
- package/lib/input/KeyboardController.d.ts +5 -0
- package/lib/math/Utils.d.ts +7 -0
- package/lib/rendering/FontAtlasFactory.d.ts +6 -1
- package/lib/rendering/renderData/MaskRenderData.d.ts +9 -0
- package/lib/rendering/renderData/RenderData.d.ts +2 -1
- package/lib/rendering/webGL/ProgramFactory.d.ts +1 -1
- package/lib/rendering/webGL/WebGLRenderer.d.ts +13 -11
- package/lib/rendering/webGL/renderer/MaskRenderer.d.ts +14 -0
- package/lib/rendering/webGL/shader/imageFragmentShader.d.ts +1 -1
- package/lib/rendering/webGL/shader/legacy/imageFragmentShader.d.ts +1 -1
- package/package.json +1 -1
- package/angry-pixel-v1.0.7.tgz +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Sprite } from "./Sprite";
|
|
2
2
|
export interface AnimationConfig {
|
|
3
3
|
sprites: Sprite[];
|
|
4
|
-
speed: number;
|
|
5
4
|
loop: boolean;
|
|
5
|
+
framerate: number;
|
|
6
6
|
}
|
|
7
7
|
export declare class Animation {
|
|
8
8
|
sprites: Sprite[];
|
|
9
|
-
|
|
9
|
+
framerate: number;
|
|
10
10
|
loop: boolean;
|
|
11
11
|
constructor(config: AnimationConfig);
|
|
12
12
|
}
|
|
@@ -9,11 +9,9 @@ export declare class Animator extends EngineComponent {
|
|
|
9
9
|
private spriteRenderer;
|
|
10
10
|
private animations;
|
|
11
11
|
private currentAnimation;
|
|
12
|
-
private defaultSprite;
|
|
13
12
|
constructor(config: AnimatorConfig);
|
|
14
|
-
protected start(): void;
|
|
15
13
|
protected update(): void;
|
|
16
|
-
addAnimation(name: string, animation: Animation): this;
|
|
14
|
+
addAnimation(name: string, animation: Animation, framerate?: number): this;
|
|
17
15
|
playAnimation(name: string): void;
|
|
18
16
|
stopAnimation(): void;
|
|
19
17
|
isPlayingAnimation(name: string): boolean;
|
|
@@ -11,8 +11,6 @@ export interface RigidBodyConfig {
|
|
|
11
11
|
}
|
|
12
12
|
export declare class RigidBody extends PhysicsComponent {
|
|
13
13
|
private timeManager;
|
|
14
|
-
private readonly gravityScale;
|
|
15
|
-
private readonly velocityScale;
|
|
16
14
|
private _rigidBodyType;
|
|
17
15
|
private _colliderComponents;
|
|
18
16
|
private _layersToCollide;
|
|
@@ -24,7 +22,6 @@ export declare class RigidBody extends PhysicsComponent {
|
|
|
24
22
|
private penetrationPerDirection;
|
|
25
23
|
private updatePosition;
|
|
26
24
|
private penetrationResolution;
|
|
27
|
-
private nextObjectPosition;
|
|
28
25
|
constructor(config: RigidBodyConfig);
|
|
29
26
|
get rigidBodyType(): RigidBodyType;
|
|
30
27
|
set velocity(velocity: Vector2);
|
|
@@ -12,6 +12,7 @@ export declare class Transform extends TransformComponent {
|
|
|
12
12
|
private cache;
|
|
13
13
|
private lastParentRadians;
|
|
14
14
|
private lastPosition;
|
|
15
|
+
private scaledInnerPosition;
|
|
15
16
|
constructor();
|
|
16
17
|
get position(): Vector2;
|
|
17
18
|
set position(position: Vector2);
|
|
@@ -27,4 +28,5 @@ export declare class Transform extends TransformComponent {
|
|
|
27
28
|
private updateInnerPositionFromParent;
|
|
28
29
|
private setPositionFromParent;
|
|
29
30
|
private translateInnerPosition;
|
|
31
|
+
private updateScaledInnerPosition;
|
|
30
32
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RenderComponent } from "../../core/Component";
|
|
2
|
+
import { Rotation } from "../../math/Rotation";
|
|
3
|
+
import { Vector2 } from "../../math/Vector2";
|
|
4
|
+
export interface MaskRendererConfig {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
color: string;
|
|
8
|
+
offset?: Vector2;
|
|
9
|
+
rotation?: Rotation;
|
|
10
|
+
opacity?: number;
|
|
11
|
+
layer?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class MaskRenderer extends RenderComponent {
|
|
14
|
+
private renderManager;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
color: string;
|
|
18
|
+
offset: Vector2;
|
|
19
|
+
rotation: Rotation;
|
|
20
|
+
opacity: number;
|
|
21
|
+
layer: string;
|
|
22
|
+
private renderData;
|
|
23
|
+
private innerPosition;
|
|
24
|
+
private scaledOffset;
|
|
25
|
+
constructor(config: MaskRendererConfig);
|
|
26
|
+
protected update(): void;
|
|
27
|
+
private calculateRenderPosition;
|
|
28
|
+
private translateRenderPosition;
|
|
29
|
+
}
|
package/lib/core/GameObject.d.ts
CHANGED
package/lib/core/Scene.d.ts
CHANGED
|
@@ -49,10 +49,6 @@ export declare class Scene {
|
|
|
49
49
|
* @returns The found game object
|
|
50
50
|
*/
|
|
51
51
|
protected findGameObjectByTag<T extends GameObject>(tag: string): T;
|
|
52
|
-
/**
|
|
53
|
-
* Desroy all the loaded game objects
|
|
54
|
-
*/
|
|
55
|
-
protected destroyAllGameObjects(): void;
|
|
56
52
|
/**
|
|
57
53
|
* Destroy one game objects by its name
|
|
58
54
|
* @param name The name of the game object
|
|
@@ -10,12 +10,12 @@ export declare class AssetManagerFacade {
|
|
|
10
10
|
* @param url The url of the image
|
|
11
11
|
* @returns The created image element
|
|
12
12
|
*/
|
|
13
|
-
static
|
|
13
|
+
static loadImage(url: string): HTMLImageElement;
|
|
14
14
|
/**
|
|
15
15
|
* @param url The url of the audio file
|
|
16
16
|
* @returns The created audio element
|
|
17
17
|
*/
|
|
18
|
-
static
|
|
18
|
+
static loadAudio(url: string): HTMLAudioElement;
|
|
19
19
|
/**
|
|
20
20
|
* @param url The url of the image element to find
|
|
21
21
|
* @returns the found image element
|
|
@@ -41,10 +41,6 @@ export declare class GameObjectManagerFacade {
|
|
|
41
41
|
* @returns The found game object
|
|
42
42
|
*/
|
|
43
43
|
static findGameObjectByTag<T extends GameObject>(tag: string): T;
|
|
44
|
-
/**
|
|
45
|
-
* Destroy all the added game objects
|
|
46
|
-
*/
|
|
47
|
-
static destroyAllGameObjects(): void;
|
|
48
44
|
/**
|
|
49
45
|
* Destroy the game objects
|
|
50
46
|
* @param gameObject The game object to destory
|
|
@@ -6,9 +6,8 @@ export declare enum AssetType {
|
|
|
6
6
|
export declare class AssetManager {
|
|
7
7
|
private assets;
|
|
8
8
|
getAssetsLoaded(): boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
createVideo(url: string): HTMLVideoElement;
|
|
9
|
+
laadImage(url: string): HTMLImageElement;
|
|
10
|
+
loadAudio(url: string): HTMLAudioElement;
|
|
12
11
|
getImage(url: string): HTMLImageElement;
|
|
13
12
|
getVideo(url: string): HTMLVideoElement;
|
|
14
13
|
getAudio(url: string): HTMLAudioElement;
|