@rpgjs/client 3.3.2 → 4.0.0-beta.3
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/LICENSE +19 -0
- package/lib/Components/AbstractComponent.d.ts +3 -2
- package/lib/Components/AbstractComponent.js +17 -28
- package/lib/Components/AbstractComponent.js.map +1 -1
- package/lib/Components/BarComponent.d.ts +2 -1
- package/lib/Components/BarComponent.js +32 -33
- package/lib/Components/BarComponent.js.map +1 -1
- package/lib/Components/Component.d.ts +3 -3
- package/lib/Components/Component.js +84 -96
- package/lib/Components/Component.js.map +1 -1
- package/lib/Components/DebugComponent.d.ts +2 -1
- package/lib/Components/DebugComponent.js +9 -10
- package/lib/Components/DebugComponent.js.map +1 -1
- package/lib/Components/ImageComponent.d.ts +2 -1
- package/lib/Components/ImageComponent.js +5 -7
- package/lib/Components/ImageComponent.js.map +1 -1
- package/lib/Components/ShapeComponent.d.ts +2 -1
- package/lib/Components/ShapeComponent.js +14 -14
- package/lib/Components/ShapeComponent.js.map +1 -1
- package/lib/Components/TextComponent.d.ts +3 -2
- package/lib/Components/TextComponent.js +10 -9
- package/lib/Components/TextComponent.js.map +1 -1
- package/lib/Components/TileComponent.d.ts +2 -1
- package/lib/Components/TileComponent.js +12 -16
- package/lib/Components/TileComponent.js.map +1 -1
- package/lib/Effects/Animation.d.ts +10 -9
- package/lib/Effects/Animation.js +36 -36
- package/lib/Effects/Animation.js.map +1 -1
- package/lib/Effects/AnimationCharacter.js +2 -5
- package/lib/Effects/AnimationCharacter.js.map +1 -1
- package/lib/Effects/Spinner.d.ts +3 -2
- package/lib/Effects/Spinner.js +2 -5
- package/lib/Effects/Spinner.js.map +1 -1
- package/lib/Effects/Timeline.d.ts +1 -1
- package/lib/Effects/Timeline.js +6 -10
- package/lib/Effects/Timeline.js.map +1 -1
- package/lib/Effects/TransitionScene.d.ts +2 -1
- package/lib/Effects/TransitionScene.js +3 -7
- package/lib/Effects/TransitionScene.js.map +1 -1
- package/lib/GameEngine.js +51 -26
- package/lib/GameEngine.js.map +1 -1
- package/lib/Interfaces/Character.js +1 -2
- package/lib/Interfaces/Scene.js +1 -2
- package/lib/KeyboardControls.d.ts +2 -1
- package/lib/KeyboardControls.js +47 -45
- package/lib/KeyboardControls.js.map +1 -1
- package/lib/Logger.js +1 -5
- package/lib/Logger.js.map +1 -1
- package/lib/Presets/AnimationSpritesheet.js +9 -13
- package/lib/Presets/AnimationSpritesheet.js.map +1 -1
- package/lib/Presets/Scene.js +2 -5
- package/lib/Presets/Scene.js.map +1 -1
- package/lib/Renderer.d.ts +5 -3
- package/lib/Renderer.js +68 -60
- package/lib/Renderer.js.map +1 -1
- package/lib/Resources.js +1 -5
- package/lib/Resources.js.map +1 -1
- package/lib/RpgClient.d.ts +3 -2
- package/lib/RpgClient.js +1 -2
- package/lib/RpgClientEngine.d.ts +2 -1
- package/lib/RpgClientEngine.js +192 -176
- package/lib/RpgClientEngine.js.map +1 -1
- package/lib/RpgGui.js +40 -41
- package/lib/RpgGui.js.map +1 -1
- package/lib/Scene/EventLayer.d.ts +4 -0
- package/lib/Scene/EventLayer.js +8 -0
- package/lib/Scene/EventLayer.js.map +1 -0
- package/lib/Scene/Map.d.ts +17 -3
- package/lib/Scene/Map.js +157 -113
- package/lib/Scene/Map.js.map +1 -1
- package/lib/Scene/Scene.d.ts +3 -3
- package/lib/Scene/Scene.js +24 -20
- package/lib/Scene/Scene.js.map +1 -1
- package/lib/Scene/SceneData.js +1 -5
- package/lib/Scene/SceneData.js.map +1 -1
- package/lib/Sound/RpgSound.js +8 -11
- package/lib/Sound/RpgSound.js.map +1 -1
- package/lib/Sound/Sound.d.ts +2 -2
- package/lib/Sound/Sound.js +1 -5
- package/lib/Sound/Sound.js.map +1 -1
- package/lib/Sound/Sounds.js +4 -8
- package/lib/Sound/Sounds.js.map +1 -1
- package/lib/Sprite/Character.d.ts +3 -2
- package/lib/Sprite/Character.js +15 -16
- package/lib/Sprite/Character.js.map +1 -1
- package/lib/Sprite/Player.js +2 -9
- package/lib/Sprite/Player.js.map +1 -1
- package/lib/Sprite/Spritesheet.d.ts +4 -4
- package/lib/Sprite/Spritesheet.js +1 -5
- package/lib/Sprite/Spritesheet.js.map +1 -1
- package/lib/Sprite/Spritesheets.js +4 -8
- package/lib/Sprite/Spritesheets.js.map +1 -1
- package/lib/Tilemap/CommonLayer.d.ts +2 -1
- package/lib/Tilemap/CommonLayer.js +7 -11
- package/lib/Tilemap/CommonLayer.js.map +1 -1
- package/lib/Tilemap/ImageLayer.js +5 -7
- package/lib/Tilemap/ImageLayer.js.map +1 -1
- package/lib/Tilemap/Tile.d.ts +5 -5
- package/lib/Tilemap/Tile.js +19 -21
- package/lib/Tilemap/Tile.js.map +1 -1
- package/lib/Tilemap/TileLayer.d.ts +0 -7
- package/lib/Tilemap/TileLayer.js +27 -29
- package/lib/Tilemap/TileLayer.js.map +1 -1
- package/lib/Tilemap/TileSet.d.ts +2 -1
- package/lib/Tilemap/TileSet.js +9 -12
- package/lib/Tilemap/TileSet.js.map +1 -1
- package/lib/Tilemap/index.d.ts +3 -11
- package/lib/Tilemap/index.js +22 -61
- package/lib/Tilemap/index.js.map +1 -1
- package/lib/clientEntryPoint.js +26 -28
- package/lib/clientEntryPoint.js.map +1 -1
- package/lib/index.js +21 -75
- package/lib/index.js.map +1 -1
- package/package.json +19 -19
- package/src/Components/AbstractComponent.ts +120 -0
- package/src/Components/BarComponent.ts +179 -0
- package/src/Components/Component.ts +506 -0
- package/src/Components/DebugComponent.ts +36 -0
- package/src/Components/ImageComponent.ts +30 -0
- package/src/Components/ShapeComponent.ts +64 -0
- package/src/Components/TextComponent.ts +33 -0
- package/src/Components/TileComponent.ts +43 -0
- package/src/Effects/Animation.ts +297 -0
- package/src/Effects/AnimationCharacter.ts +7 -0
- package/src/Effects/Spinner.ts +19 -0
- package/src/Effects/Timeline.ts +294 -0
- package/src/Effects/TransitionScene.ts +57 -0
- package/src/GameEngine.ts +284 -0
- package/src/Interfaces/Character.ts +7 -0
- package/src/Interfaces/Scene.ts +9 -0
- package/src/KeyboardControls.ts +552 -0
- package/src/Logger.ts +3 -0
- package/src/Presets/AnimationSpritesheet.ts +36 -0
- package/src/Presets/Scene.ts +3 -0
- package/src/Renderer.ts +263 -0
- package/src/Resources.ts +40 -0
- package/src/RpgClient.ts +333 -0
- package/src/RpgClientEngine.ts +709 -0
- package/src/RpgGui.ts +553 -0
- package/src/RpgGuiCompiled.ts +43 -0
- package/src/Scene/EventLayer.ts +9 -0
- package/src/Scene/Map.ts +393 -0
- package/src/Scene/Scene.ts +270 -0
- package/src/Scene/SceneData.ts +13 -0
- package/src/Sound/RpgSound.ts +50 -0
- package/src/Sound/Sound.ts +91 -0
- package/src/Sound/Sounds.ts +7 -0
- package/src/Sprite/Character.ts +149 -0
- package/src/Sprite/Player.ts +3 -0
- package/src/Sprite/Spritesheet.ts +392 -0
- package/src/Sprite/Spritesheets.ts +8 -0
- package/src/Tilemap/CommonLayer.ts +20 -0
- package/src/Tilemap/ImageLayer.ts +20 -0
- package/src/Tilemap/Tile.ts +80 -0
- package/src/Tilemap/TileLayer.ts +142 -0
- package/src/Tilemap/TileSet.ts +40 -0
- package/src/Tilemap/index.ts +173 -0
- package/src/clientEntryPoint.ts +141 -0
- package/src/index.ts +25 -0
- package/src/types/howler.d.ts +73 -0
- package/tsconfig.json +30 -0
- package/lib/Components/ColorComponent.d.ts +0 -9
- package/lib/Components/ColorComponent.js +0 -18
- package/lib/Components/ColorComponent.js.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
declare module "howler" {
|
|
2
|
+
|
|
3
|
+
class HowlerGlobal {
|
|
4
|
+
stop(): HowlerGlobal
|
|
5
|
+
mute(): HowlerGlobal;
|
|
6
|
+
unmute(): HowlerGlobal;
|
|
7
|
+
volume(): number;
|
|
8
|
+
volume(volume: number): HowlerGlobal;
|
|
9
|
+
codecs(extension: string): boolean;
|
|
10
|
+
iOSAutoEnable: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var Howler: HowlerGlobal;
|
|
14
|
+
|
|
15
|
+
interface IHowlCallback {
|
|
16
|
+
(): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface IHowlSoundSpriteDefinition {
|
|
20
|
+
[name: string]: number[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface IHowlProperties {
|
|
24
|
+
autoplay?: boolean;
|
|
25
|
+
buffer?: boolean;
|
|
26
|
+
format?: string;
|
|
27
|
+
loop?: boolean;
|
|
28
|
+
sprite?: IHowlSoundSpriteDefinition;
|
|
29
|
+
volume?: number;
|
|
30
|
+
src: string[]
|
|
31
|
+
urls?: string[];
|
|
32
|
+
onend?: IHowlCallback;
|
|
33
|
+
onload?: IHowlCallback;
|
|
34
|
+
onloaderror?: IHowlCallback;
|
|
35
|
+
onpause?: IHowlCallback;
|
|
36
|
+
onplay?: IHowlCallback;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
class Howl {
|
|
40
|
+
|
|
41
|
+
autoplay: Boolean;
|
|
42
|
+
buffer: Boolean;
|
|
43
|
+
format: string;
|
|
44
|
+
rate: number;
|
|
45
|
+
model: string;
|
|
46
|
+
onend: IHowlCallback;
|
|
47
|
+
onload: IHowlCallback;
|
|
48
|
+
onloaderror: IHowlCallback;
|
|
49
|
+
onpause: IHowlCallback;
|
|
50
|
+
onplay: IHowlCallback;
|
|
51
|
+
constructor(properties: IHowlProperties);
|
|
52
|
+
play(sprite?: string, callback?: (soundId: number) => void): Howl;
|
|
53
|
+
playing(): boolean
|
|
54
|
+
pause(soundId?: number): Howl;
|
|
55
|
+
stop(soundId?: number): Howl;
|
|
56
|
+
mute(soundId?: number): Howl;
|
|
57
|
+
unmute(soundId?: number): Howl;
|
|
58
|
+
fade(from: number, to: number, duration: number, callback?: IHowlCallback, soundId?: number): Howl;
|
|
59
|
+
loop(): boolean;
|
|
60
|
+
loop(loop: boolean): Howl;
|
|
61
|
+
pos(position?: number, soundId?: number): number;
|
|
62
|
+
pos3d(x: number, y: number, z: number, soundId?: number): any;
|
|
63
|
+
sprite(definition?: IHowlSoundSpriteDefinition): IHowlSoundSpriteDefinition;
|
|
64
|
+
volume(): number;
|
|
65
|
+
volume(volume?: number, soundId?: number): Howl;
|
|
66
|
+
urls(): string[];
|
|
67
|
+
urls(urls: string[]): Howl;
|
|
68
|
+
on(event: string, listener?: () => void): Howl;
|
|
69
|
+
off(event: string, listener?: () => void): Howl;
|
|
70
|
+
unload(): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"lib": ["dom", "esnext"],
|
|
5
|
+
"module": "ES2020",
|
|
6
|
+
"outDir": "./lib",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"strictNullChecks": true,
|
|
11
|
+
"strictPropertyInitialization": false,
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"removeComments": false,
|
|
15
|
+
"noUnusedParameters": false,
|
|
16
|
+
"noUnusedLocals": false,
|
|
17
|
+
"noImplicitThis": false,
|
|
18
|
+
"noImplicitAny": false,
|
|
19
|
+
"noImplicitReturns": false,
|
|
20
|
+
"declaration": true,
|
|
21
|
+
"experimentalDecorators": true,
|
|
22
|
+
"emitDecoratorMetadata": true,
|
|
23
|
+
"stripInternal": true,
|
|
24
|
+
"skipLibCheck": true
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"src"
|
|
28
|
+
],
|
|
29
|
+
|
|
30
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RpgComponent } from "./Component";
|
|
2
|
-
import { Graphics } from "pixi.js";
|
|
3
|
-
export declare class ColorComponent extends Graphics {
|
|
4
|
-
private component;
|
|
5
|
-
color: string;
|
|
6
|
-
static readonly id: string;
|
|
7
|
-
constructor(component: RpgComponent, color: string);
|
|
8
|
-
setBackgroundColor(): void;
|
|
9
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Graphics } from "pixi.js";
|
|
2
|
-
class ColorComponent extends Graphics {
|
|
3
|
-
constructor(component, color) {
|
|
4
|
-
super();
|
|
5
|
-
this.component = component;
|
|
6
|
-
this.color = color;
|
|
7
|
-
this.setBackgroundColor();
|
|
8
|
-
}
|
|
9
|
-
setBackgroundColor() {
|
|
10
|
-
const color = this.color.replace('#', '');
|
|
11
|
-
this.beginFill(parseInt(color, 16));
|
|
12
|
-
this.drawRect(0, 0, this.component.w, this.component.h);
|
|
13
|
-
this.endFill();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
ColorComponent.id = 'color';
|
|
17
|
-
export { ColorComponent };
|
|
18
|
-
//# sourceMappingURL=ColorComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorComponent.js","sourceRoot":"","sources":["../../src/Components/ColorComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,MAAa,cAAe,SAAQ,QAAQ;IAGxC,YAAoB,SAAuB,EAAS,KAAa;QAC7D,KAAK,EAAE,CAAA;QADS,cAAS,GAAT,SAAS,CAAc;QAAS,UAAK,GAAL,KAAK,CAAQ;QAE7D,IAAI,CAAC,kBAAkB,EAAE,CAAA;IAC7B,CAAC;IAED,kBAAkB;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QACzC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAA;QACnC,IAAI,CAAC,QAAQ,CACT,CAAC,EACD,CAAC,EACD,IAAI,CAAC,SAAS,CAAC,CAAC,EAChB,IAAI,CAAC,SAAS,CAAC,CAAC,CACnB,CAAC;QACF,IAAI,CAAC,OAAO,EAAE,CAAA;IAClB,CAAC;;AAjBe,iBAAE,GAAW,OAAO,CAAA;SAD3B,cAAc"}
|