@rpgjs/client 4.3.0 → 5.0.0-alpha.0
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/dist/Game/EffectManager.d.ts +5 -0
- package/dist/Game/Event.d.ts +4 -0
- package/dist/Game/Map.d.ts +7 -0
- package/dist/Game/Player.d.ts +4 -0
- package/dist/Gui/Gui.d.ts +23 -0
- package/{lib → dist}/RpgClient.d.ts +9 -6
- package/dist/RpgClientEngine.d.ts +43 -0
- package/dist/components/effects/index.d.ts +4 -0
- package/dist/components/gui/index.d.ts +3 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/core/inject.d.ts +5 -0
- package/dist/core/setup.d.ts +6 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/index10.js +8 -0
- package/dist/index10.js.map +1 -0
- package/dist/index11.js +10 -0
- package/dist/index11.js.map +1 -0
- package/dist/index12.js +8 -0
- package/dist/index12.js.map +1 -0
- package/dist/index13.js +17 -0
- package/dist/index13.js.map +1 -0
- package/dist/index14.js +50 -0
- package/dist/index14.js.map +1 -0
- package/dist/index15.js +191 -0
- package/dist/index15.js.map +1 -0
- package/dist/index16.js +9 -0
- package/dist/index16.js.map +1 -0
- package/dist/index17.js +387 -0
- package/dist/index17.js.map +1 -0
- package/dist/index18.js +31 -0
- package/dist/index18.js.map +1 -0
- package/dist/index19.js +24 -0
- package/dist/index19.js.map +1 -0
- package/dist/index2.js +112 -0
- package/dist/index2.js.map +1 -0
- package/dist/index20.js +2421 -0
- package/dist/index20.js.map +1 -0
- package/dist/index21.js +114 -0
- package/dist/index21.js.map +1 -0
- package/dist/index22.js +109 -0
- package/dist/index22.js.map +1 -0
- package/dist/index23.js +71 -0
- package/dist/index23.js.map +1 -0
- package/dist/index24.js +21 -0
- package/dist/index24.js.map +1 -0
- package/dist/index25.js +41 -0
- package/dist/index25.js.map +1 -0
- package/dist/index26.js +5 -0
- package/dist/index26.js.map +1 -0
- package/dist/index27.js +322 -0
- package/dist/index27.js.map +1 -0
- package/dist/index28.js +25 -0
- package/dist/index28.js.map +1 -0
- package/dist/index29.js +11 -0
- package/dist/index29.js.map +1 -0
- package/dist/index3.js +87 -0
- package/dist/index3.js.map +1 -0
- package/dist/index30.js +11 -0
- package/dist/index30.js.map +1 -0
- package/dist/index31.js +174 -0
- package/dist/index31.js.map +1 -0
- package/dist/index32.js +501 -0
- package/dist/index32.js.map +1 -0
- package/dist/index33.js +12 -0
- package/dist/index33.js.map +1 -0
- package/dist/index34.js +4403 -0
- package/dist/index34.js.map +1 -0
- package/dist/index35.js +91 -0
- package/dist/index35.js.map +1 -0
- package/dist/index36.js +61 -0
- package/dist/index36.js.map +1 -0
- package/dist/index37.js +20 -0
- package/dist/index37.js.map +1 -0
- package/dist/index38.js +20 -0
- package/dist/index38.js.map +1 -0
- package/dist/index4.js +54 -0
- package/dist/index4.js.map +1 -0
- package/dist/index5.js +15 -0
- package/dist/index5.js.map +1 -0
- package/dist/index6.js +17 -0
- package/dist/index6.js.map +1 -0
- package/dist/index7.js +31 -0
- package/dist/index7.js.map +1 -0
- package/dist/index8.js +90 -0
- package/dist/index8.js.map +1 -0
- package/dist/index9.js +76 -0
- package/dist/index9.js.map +1 -0
- package/dist/module.d.ts +14 -0
- package/dist/presets/index.d.ts +22 -0
- package/{lib/Presets/AnimationSpritesheet.d.ts → dist/presets/rmspritesheet.d.ts} +6 -2
- package/dist/services/AbstractSocket.d.ts +15 -0
- package/dist/services/loadMap.d.ts +14 -0
- package/dist/services/mmorpg.d.ts +32 -0
- package/dist/services/standalone.d.ts +34 -0
- package/package.json +25 -41
- package/src/Game/EffectManager.ts +20 -0
- package/src/Game/Event.ts +5 -0
- package/src/Game/Map.ts +10 -0
- package/src/Game/Object.ts +16 -0
- package/src/Game/Player.ts +5 -0
- package/src/Gui/Gui.ts +80 -533
- package/src/RpgClient.ts +9 -5
- package/src/RpgClientEngine.ts +135 -818
- package/src/components/character.ce +104 -0
- package/src/components/effects/animation.ce +19 -0
- package/src/components/effects/hit.ce +87 -0
- package/src/components/effects/index.ts +7 -0
- package/src/components/gui/dialogbox/index.ce +194 -0
- package/src/components/gui/dialogbox/itemMenu.ce +23 -0
- package/src/components/gui/dialogbox/selection.ce +67 -0
- package/src/components/gui/index.ts +5 -0
- package/src/components/index.ts +3 -0
- package/src/components/scenes/canvas.ce +51 -0
- package/src/components/scenes/draw-map.ce +56 -0
- package/src/components/scenes/element-map.ce +23 -0
- package/src/components/scenes/event-layer.ce +20 -0
- package/src/core/inject.ts +17 -0
- package/src/core/setup.ts +18 -0
- package/src/index.ts +13 -29
- package/src/module.ts +93 -0
- package/src/presets/index.ts +5 -0
- package/src/{Presets/AnimationSpritesheet.ts → presets/rmspritesheet.ts} +4 -5
- package/src/services/AbstractSocket.ts +14 -0
- package/src/services/loadMap.ts +33 -0
- package/src/services/mmorpg.ts +64 -0
- package/src/services/standalone.ts +101 -0
- package/src/types/canvas-engine.d.ts +26 -0
- package/tsconfig.json +8 -3
- package/vite.config.ts +34 -0
- package/CHANGELOG.md +0 -189
- package/LICENSE +0 -19
- package/browser/React-ece4b906.js +0 -195
- package/browser/index-ba657126.js +0 -44229
- package/browser/manifest.json +0 -21
- package/browser/rpg.client.js +0 -40
- package/browser/rpg.client.umd.cjs +0 -44456
- package/lib/Components/AbstractComponent.d.ts +0 -32
- package/lib/Components/AbstractComponent.js +0 -93
- package/lib/Components/AbstractComponent.js.map +0 -1
- package/lib/Components/BarComponent.d.ts +0 -21
- package/lib/Components/BarComponent.js +0 -169
- package/lib/Components/BarComponent.js.map +0 -1
- package/lib/Components/Component.d.ts +0 -124
- package/lib/Components/Component.js +0 -425
- package/lib/Components/Component.js.map +0 -1
- package/lib/Components/DebugComponent.d.ts +0 -11
- package/lib/Components/DebugComponent.js +0 -32
- package/lib/Components/DebugComponent.js.map +0 -1
- package/lib/Components/ImageComponent.d.ts +0 -11
- package/lib/Components/ImageComponent.js +0 -30
- package/lib/Components/ImageComponent.js.map +0 -1
- package/lib/Components/ShapeComponent.d.ts +0 -11
- package/lib/Components/ShapeComponent.js +0 -57
- package/lib/Components/ShapeComponent.js.map +0 -1
- package/lib/Components/TextComponent.d.ts +0 -11
- package/lib/Components/TextComponent.js +0 -35
- package/lib/Components/TextComponent.js.map +0 -1
- package/lib/Components/TileComponent.d.ts +0 -10
- package/lib/Components/TileComponent.js +0 -40
- package/lib/Components/TileComponent.js.map +0 -1
- package/lib/Effects/Animation.d.ts +0 -55
- package/lib/Effects/Animation.js +0 -233
- package/lib/Effects/Animation.js.map +0 -1
- package/lib/Effects/AnimationCharacter.d.ts +0 -7
- package/lib/Effects/AnimationCharacter.js +0 -9
- package/lib/Effects/AnimationCharacter.js.map +0 -1
- package/lib/Effects/Spinner.d.ts +0 -7
- package/lib/Effects/Spinner.js +0 -18
- package/lib/Effects/Spinner.js.map +0 -1
- package/lib/Effects/Timeline.d.ts +0 -151
- package/lib/Effects/Timeline.js +0 -369
- package/lib/Effects/Timeline.js.map +0 -1
- package/lib/Effects/TransitionScene.d.ts +0 -18
- package/lib/Effects/TransitionScene.js +0 -50
- package/lib/Effects/TransitionScene.js.map +0 -1
- package/lib/GameEngine.d.ts +0 -68
- package/lib/GameEngine.js +0 -254
- package/lib/GameEngine.js.map +0 -1
- package/lib/Gui/Gui.d.ts +0 -110
- package/lib/Gui/Gui.js +0 -489
- package/lib/Gui/Gui.js.map +0 -1
- package/lib/Gui/React.d.ts +0 -28
- package/lib/Gui/React.js +0 -147
- package/lib/Gui/React.js.map +0 -1
- package/lib/Gui/Vue.d.ts +0 -13
- package/lib/Gui/Vue.js +0 -114
- package/lib/Gui/Vue.js.map +0 -1
- package/lib/Interfaces/Character.d.ts +0 -6
- package/lib/Interfaces/Character.js +0 -2
- package/lib/Interfaces/Character.js.map +0 -1
- package/lib/Interfaces/Scene.d.ts +0 -10
- package/lib/Interfaces/Scene.js +0 -2
- package/lib/Interfaces/Scene.js.map +0 -1
- package/lib/KeyboardControls.d.ts +0 -367
- package/lib/KeyboardControls.js +0 -714
- package/lib/KeyboardControls.js.map +0 -1
- package/lib/Logger.d.ts +0 -1
- package/lib/Logger.js +0 -4
- package/lib/Logger.js.map +0 -1
- package/lib/Presets/AnimationSpritesheet.js +0 -39
- package/lib/Presets/AnimationSpritesheet.js.map +0 -1
- package/lib/Presets/Scene.d.ts +0 -3
- package/lib/Presets/Scene.js +0 -5
- package/lib/Presets/Scene.js.map +0 -1
- package/lib/Renderer.d.ts +0 -62
- package/lib/Renderer.js +0 -300
- package/lib/Renderer.js.map +0 -1
- package/lib/Resources.d.ts +0 -22
- package/lib/Resources.js +0 -38
- package/lib/Resources.js.map +0 -1
- package/lib/RpgClient.js +0 -2
- package/lib/RpgClient.js.map +0 -1
- package/lib/RpgClientEngine.d.ts +0 -257
- package/lib/RpgClientEngine.js +0 -677
- package/lib/RpgClientEngine.js.map +0 -1
- package/lib/Scene/EventLayer.d.ts +0 -4
- package/lib/Scene/EventLayer.js +0 -8
- package/lib/Scene/EventLayer.js.map +0 -1
- package/lib/Scene/Map.d.ts +0 -109
- package/lib/Scene/Map.js +0 -319
- package/lib/Scene/Map.js.map +0 -1
- package/lib/Scene/Scene.d.ts +0 -184
- package/lib/Scene/Scene.js +0 -250
- package/lib/Scene/Scene.js.map +0 -1
- package/lib/Scene/SceneData.d.ts +0 -4
- package/lib/Scene/SceneData.js +0 -8
- package/lib/Scene/SceneData.js.map +0 -1
- package/lib/Sound/RpgSound.d.ts +0 -11
- package/lib/Sound/RpgSound.js +0 -46
- package/lib/Sound/RpgSound.js.map +0 -1
- package/lib/Sound/Sound.d.ts +0 -78
- package/lib/Sound/Sound.js +0 -12
- package/lib/Sound/Sound.js.map +0 -1
- package/lib/Sound/Sounds.d.ts +0 -2
- package/lib/Sound/Sounds.js +0 -6
- package/lib/Sound/Sounds.js.map +0 -1
- package/lib/Sprite/Character.d.ts +0 -18
- package/lib/Sprite/Character.js +0 -131
- package/lib/Sprite/Character.js.map +0 -1
- package/lib/Sprite/Player.d.ts +0 -3
- package/lib/Sprite/Player.js +0 -4
- package/lib/Sprite/Player.js.map +0 -1
- package/lib/Sprite/Spritesheet.d.ts +0 -365
- package/lib/Sprite/Spritesheet.js +0 -13
- package/lib/Sprite/Spritesheet.js.map +0 -1
- package/lib/Sprite/Spritesheets.d.ts +0 -3
- package/lib/Sprite/Spritesheets.js +0 -6
- package/lib/Sprite/Spritesheets.js.map +0 -1
- package/lib/Tilemap/CommonLayer.d.ts +0 -10
- package/lib/Tilemap/CommonLayer.js +0 -17
- package/lib/Tilemap/CommonLayer.js.map +0 -1
- package/lib/Tilemap/ImageLayer.d.ts +0 -4
- package/lib/Tilemap/ImageLayer.js +0 -16
- package/lib/Tilemap/ImageLayer.js.map +0 -1
- package/lib/Tilemap/Tile.d.ts +0 -21
- package/lib/Tilemap/Tile.js +0 -67
- package/lib/Tilemap/Tile.js.map +0 -1
- package/lib/Tilemap/TileLayer.d.ts +0 -13
- package/lib/Tilemap/TileLayer.js +0 -122
- package/lib/Tilemap/TileLayer.js.map +0 -1
- package/lib/Tilemap/TileSet.d.ts +0 -7
- package/lib/Tilemap/TileSet.js +0 -24
- package/lib/Tilemap/TileSet.js.map +0 -1
- package/lib/Tilemap/index.d.ts +0 -28
- package/lib/Tilemap/index.js +0 -151
- package/lib/Tilemap/index.js.map +0 -1
- package/lib/clientEntryPoint.d.ts +0 -89
- package/lib/clientEntryPoint.js +0 -48
- package/lib/clientEntryPoint.js.map +0 -1
- package/lib/index.d.ts +0 -26
- package/lib/index.js +0 -27
- package/lib/index.js.map +0 -1
- package/lib/inject.d.ts +0 -23
- package/lib/inject.js +0 -30
- package/lib/inject.js.map +0 -1
- package/rpg.toml +0 -14
- package/src/Components/AbstractComponent.ts +0 -120
- package/src/Components/BarComponent.ts +0 -181
- package/src/Components/Component.ts +0 -515
- package/src/Components/DebugComponent.ts +0 -36
- package/src/Components/ImageComponent.ts +0 -30
- package/src/Components/ShapeComponent.ts +0 -64
- package/src/Components/TextComponent.ts +0 -33
- package/src/Components/TileComponent.ts +0 -43
- package/src/Effects/Animation.ts +0 -310
- package/src/Effects/AnimationCharacter.ts +0 -7
- package/src/Effects/Spinner.ts +0 -19
- package/src/Effects/Timeline.ts +0 -378
- package/src/Effects/TransitionScene.ts +0 -59
- package/src/GameEngine.ts +0 -289
- package/src/Gui/React.ts +0 -193
- package/src/Gui/Vue.ts +0 -154
- package/src/Interfaces/Character.ts +0 -7
- package/src/Interfaces/Scene.ts +0 -9
- package/src/KeyboardControls.ts +0 -748
- package/src/Logger.ts +0 -3
- package/src/Presets/Scene.ts +0 -3
- package/src/Renderer.ts +0 -334
- package/src/Resources.ts +0 -39
- package/src/Scene/EventLayer.ts +0 -9
- package/src/Scene/Map.ts +0 -402
- package/src/Scene/Scene.ts +0 -305
- package/src/Scene/SceneData.ts +0 -13
- package/src/Sound/RpgSound.ts +0 -50
- package/src/Sound/Sound.ts +0 -91
- package/src/Sound/Sounds.ts +0 -7
- package/src/Sprite/Character.ts +0 -157
- package/src/Sprite/Player.ts +0 -3
- package/src/Sprite/Spritesheet.ts +0 -392
- package/src/Sprite/Spritesheets.ts +0 -8
- package/src/Tilemap/CommonLayer.ts +0 -20
- package/src/Tilemap/ImageLayer.ts +0 -20
- package/src/Tilemap/Tile.ts +0 -80
- package/src/Tilemap/TileLayer.ts +0 -142
- package/src/Tilemap/TileSet.ts +0 -40
- package/src/Tilemap/index.ts +0 -175
- package/src/clientEntryPoint.ts +0 -150
- package/src/inject.ts +0 -34
- package/src/types/howler.d.ts +0 -73
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Text } from "pixi.js";
|
|
2
|
-
import { AbstractComponent } from "./AbstractComponent.js";
|
|
3
|
-
class TextComponent extends AbstractComponent {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.cacheParams = [];
|
|
7
|
-
this.container = new Text('');
|
|
8
|
-
this.originValue = '';
|
|
9
|
-
}
|
|
10
|
-
onInit(cell) {
|
|
11
|
-
if (typeof this.value == 'string') {
|
|
12
|
-
this.container.text = this.value;
|
|
13
|
-
}
|
|
14
|
-
else if (this.value.style) {
|
|
15
|
-
this.container.style = this.value.style;
|
|
16
|
-
this.container.text = this.value.text;
|
|
17
|
-
}
|
|
18
|
-
this.container.style = {
|
|
19
|
-
...this.container.style,
|
|
20
|
-
wordWrapWidth: cell.width
|
|
21
|
-
};
|
|
22
|
-
this.parseTextAndCache(this.container.text);
|
|
23
|
-
this.originValue = this.container.text;
|
|
24
|
-
// first render for replace variable and remove {}
|
|
25
|
-
this.updateRender(this.component.logic);
|
|
26
|
-
this.addChild(this.container);
|
|
27
|
-
super.onInit(cell);
|
|
28
|
-
}
|
|
29
|
-
updateRender(object) {
|
|
30
|
-
this.container.text = this.replaceText(object, this.originValue);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
TextComponent.id = 'text';
|
|
34
|
-
export { TextComponent };
|
|
35
|
-
//# sourceMappingURL=TextComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextComponent.js","sourceRoot":"","sources":["../../src/Components/TextComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,IAAI,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD,MAAa,aAAc,SAAQ,iBAA4C;IAA/E;;QAEI,gBAAW,GAAa,EAAE,CAAA;QAClB,cAAS,GAAS,IAAI,IAAI,CAAC,EAAE,CAAC,CAAA;QAC9B,gBAAW,GAAW,EAAE,CAAA;IAwBpC,CAAC;IAtBG,MAAM,CAAC,IAAc;QACjB,IAAI,OAAO,IAAI,CAAC,KAAK,IAAI,QAAQ,EAAE;YAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;SACnC;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;YACzB,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;YACvC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAA;SACxC;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG;YACnB,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK;YACvB,aAAa,EAAE,IAAI,CAAC,KAAK;SAC5B,CAAA;QACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAC3C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAA;QACtC,kDAAkD;QAClD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QACvC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAC7B,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACtB,CAAC;IAED,YAAY,CAAC,MAAW;QACpB,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IACpE,CAAC;;AA1Be,gBAAE,GAAW,MAAM,AAAjB,CAAiB;SAD1B,aAAa"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TileComponentObject } from "@rpgjs/types";
|
|
2
|
-
import { AbstractComponent, CellInfo } from "./AbstractComponent.js";
|
|
3
|
-
import { Container } from "pixi.js";
|
|
4
|
-
export declare class TileComponent extends AbstractComponent<TileComponentObject, Container> {
|
|
5
|
-
static readonly id: string;
|
|
6
|
-
cacheParams: string[];
|
|
7
|
-
gid: number;
|
|
8
|
-
onInit(cell: CellInfo): void;
|
|
9
|
-
updateRender(object: any): void;
|
|
10
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import Tile from "../Tilemap/Tile.js";
|
|
2
|
-
import TileLayer from "../Tilemap/TileLayer.js";
|
|
3
|
-
import { AbstractComponent } from "./AbstractComponent.js";
|
|
4
|
-
class TileComponent extends AbstractComponent {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.cacheParams = [];
|
|
8
|
-
this.gid = 0;
|
|
9
|
-
}
|
|
10
|
-
onInit(cell) {
|
|
11
|
-
this.cell = cell;
|
|
12
|
-
if (typeof this.value == 'number') {
|
|
13
|
-
this.gid = this.value;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
this.gid = this.value.gid;
|
|
17
|
-
}
|
|
18
|
-
this.updateRender({});
|
|
19
|
-
super.onInit(cell);
|
|
20
|
-
}
|
|
21
|
-
updateRender(object) {
|
|
22
|
-
this.removeChildren();
|
|
23
|
-
const height = typeof this.value != 'number' ? this.getValue(object, this.value.height) : null ?? this.cell?.height ?? 0;
|
|
24
|
-
const width = typeof this.value != 'number' ? this.getValue(object, this.value.width) : null ?? this.cell?.width ?? 0;
|
|
25
|
-
const scene = this.component.getScene();
|
|
26
|
-
const tilemap = scene.tilemap;
|
|
27
|
-
const tileset = TileLayer.findTileSet(this.gid, tilemap.tilesets);
|
|
28
|
-
if (tileset) {
|
|
29
|
-
const tile = new Tile({
|
|
30
|
-
gid: this.gid
|
|
31
|
-
}, tileset);
|
|
32
|
-
tile.width = width ?? 0;
|
|
33
|
-
tile.height = height ?? 0;
|
|
34
|
-
this.addChild(tile);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
TileComponent.id = 'tile';
|
|
39
|
-
export { TileComponent };
|
|
40
|
-
//# sourceMappingURL=TileComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TileComponent.js","sourceRoot":"","sources":["../../src/Components/TileComponent.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAClC,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,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OAAO,CAAC,QAAQ,CACnB,CAAA;QACD,IAAI,OAAO,EAAE;YACT,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC;gBAClB,GAAG,EAAE,IAAI,CAAC,GAAG;aACT,EAAE,OAAO,CAAC,CAAA;YAClB,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,CAAC,CAAA;YACvB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,CAAA;YACzB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;SACtB;IACL,CAAC;;AAjCe,gBAAE,GAAW,MAAM,AAAjB,CAAiB;SAD1B,aAAa"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { SpritesheetOptions, TextureOptions, AnimationFrames, FrameOptions, TransformOptions } from '../Sprite/Spritesheet.js';
|
|
2
|
-
import { RpgComponent } from '../Components/Component.js';
|
|
3
|
-
import { Sprite, Container, Texture } from 'pixi.js';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
type Image = {
|
|
6
|
-
image: string;
|
|
7
|
-
};
|
|
8
|
-
type TextureOptionsMerging = TextureOptions & {
|
|
9
|
-
spriteWidth: number;
|
|
10
|
-
spriteHeight: number;
|
|
11
|
-
sound?: string;
|
|
12
|
-
} & Image & TransformOptions;
|
|
13
|
-
type FrameOptionsMerging = TextureOptionsMerging & FrameOptions;
|
|
14
|
-
type SpritesheetOptionsMerging = TextureOptionsMerging & SpritesheetOptions;
|
|
15
|
-
type AnimationDataFrames = {
|
|
16
|
-
container: Container;
|
|
17
|
-
sprites: FrameOptionsMerging[];
|
|
18
|
-
frames: Texture[][];
|
|
19
|
-
name: string;
|
|
20
|
-
animations: AnimationFrames;
|
|
21
|
-
params: any[];
|
|
22
|
-
data: TextureOptionsMerging;
|
|
23
|
-
};
|
|
24
|
-
export declare class Animation extends Sprite {
|
|
25
|
-
id: string;
|
|
26
|
-
private _attachTo;
|
|
27
|
-
hitbox: {
|
|
28
|
-
w: number;
|
|
29
|
-
h: number;
|
|
30
|
-
};
|
|
31
|
-
applyTransform: (frame: FrameOptionsMerging, data: TextureOptionsMerging, spritesheet: SpritesheetOptionsMerging) => Partial<FrameOptionsMerging>;
|
|
32
|
-
private spritesheet;
|
|
33
|
-
private currentAnimation;
|
|
34
|
-
private time;
|
|
35
|
-
private frameIndex;
|
|
36
|
-
private animations;
|
|
37
|
-
private _animation$;
|
|
38
|
-
readonly animation$: Observable<Sprite | null>;
|
|
39
|
-
onFinish: () => void;
|
|
40
|
-
get attachTo(): RpgComponent | undefined;
|
|
41
|
-
set attachTo(component: RpgComponent | undefined);
|
|
42
|
-
constructor(id: string);
|
|
43
|
-
private createTextures;
|
|
44
|
-
private createAnimations;
|
|
45
|
-
private getSpriteSize;
|
|
46
|
-
getSpriteHeight(): number;
|
|
47
|
-
getSpriteWidth(): number;
|
|
48
|
-
has(name: string): boolean;
|
|
49
|
-
get(name: string): AnimationDataFrames;
|
|
50
|
-
isPlaying(name?: string): boolean;
|
|
51
|
-
stop(): void;
|
|
52
|
-
play(name: string, params?: any[]): void;
|
|
53
|
-
update(deltaRatio: number): void;
|
|
54
|
-
}
|
|
55
|
-
export {};
|
package/lib/Effects/Animation.js
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { Utils } from '@rpgjs/common';
|
|
2
|
-
import { spritesheets } from '../Sprite/Spritesheets.js';
|
|
3
|
-
import { log } from '../Logger.js';
|
|
4
|
-
import { RpgSound } from '../Sound/RpgSound.js';
|
|
5
|
-
import { Sprite, Container, Texture, Rectangle } from 'pixi.js';
|
|
6
|
-
import { Animation as AnimationEnum } from './AnimationCharacter.js';
|
|
7
|
-
import { BehaviorSubject } from 'rxjs';
|
|
8
|
-
const { isFunction, arrayEquals } = Utils;
|
|
9
|
-
export class Animation extends Sprite {
|
|
10
|
-
get attachTo() {
|
|
11
|
-
return this._attachTo;
|
|
12
|
-
}
|
|
13
|
-
set attachTo(component) {
|
|
14
|
-
if (!component)
|
|
15
|
-
return;
|
|
16
|
-
component.animationIsPlaying = true;
|
|
17
|
-
this._attachTo = component;
|
|
18
|
-
}
|
|
19
|
-
constructor(id) {
|
|
20
|
-
super();
|
|
21
|
-
this.id = id;
|
|
22
|
-
this.currentAnimation = null;
|
|
23
|
-
this.time = 0;
|
|
24
|
-
this.frameIndex = 0;
|
|
25
|
-
this.animations = new Map();
|
|
26
|
-
this._animation$ = new BehaviorSubject(null);
|
|
27
|
-
this.animation$ = this._animation$.asObservable();
|
|
28
|
-
this.spritesheet = spritesheets.get(this.id);
|
|
29
|
-
if (!this.spritesheet) {
|
|
30
|
-
throw log(`Impossible to find the ${this.id} spritesheet. Did you put the right name or create the spritesheet?`);
|
|
31
|
-
}
|
|
32
|
-
this.createAnimations();
|
|
33
|
-
}
|
|
34
|
-
createTextures(options) {
|
|
35
|
-
const { width, height, framesHeight, framesWidth, image, offset } = options;
|
|
36
|
-
const { baseTexture } = Texture.from(image);
|
|
37
|
-
const spriteWidth = options.spriteWidth;
|
|
38
|
-
const spriteHeight = options.spriteHeight;
|
|
39
|
-
const frames = [];
|
|
40
|
-
const offsetX = (offset && offset.x) || 0;
|
|
41
|
-
const offsetY = (offset && offset.y) || 0;
|
|
42
|
-
for (let i = 0; i < framesHeight; i++) {
|
|
43
|
-
frames[i] = [];
|
|
44
|
-
for (let j = 0; j < framesWidth; j++) {
|
|
45
|
-
const rectX = j * spriteWidth + offsetX;
|
|
46
|
-
const rectY = i * spriteHeight + offsetY;
|
|
47
|
-
if (rectY > height) {
|
|
48
|
-
throw log(`Warning, there is a problem with the height of the "${this.id}" spritesheet. When cutting into frames, the frame exceeds the height of the image.`);
|
|
49
|
-
}
|
|
50
|
-
if (rectX > width) {
|
|
51
|
-
throw log(`Warning, there is a problem with the width of the "${this.id}" spritesheet. When cutting into frames, the frame exceeds the width of the image.`);
|
|
52
|
-
}
|
|
53
|
-
frames[i].push(new Texture(baseTexture, new Rectangle(rectX, rectY, spriteWidth, spriteHeight)));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return frames;
|
|
57
|
-
}
|
|
58
|
-
createAnimations() {
|
|
59
|
-
const { textures } = this.spritesheet;
|
|
60
|
-
if (!textures) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
for (let animationName in textures) {
|
|
64
|
-
const props = ['width', 'height', 'framesHeight', 'framesWidth', 'rectWidth', 'rectHeight', 'offset', 'image', 'sound'];
|
|
65
|
-
const parentObj = props
|
|
66
|
-
.reduce((prev, val) => ({ ...prev, [val]: this.spritesheet[val] }), {});
|
|
67
|
-
const optionsTextures = {
|
|
68
|
-
...parentObj,
|
|
69
|
-
...textures[animationName]
|
|
70
|
-
};
|
|
71
|
-
const { rectWidth, width = 0, framesWidth = 1, rectHeight, height = 0, framesHeight = 1 } = optionsTextures;
|
|
72
|
-
optionsTextures.spriteWidth = rectWidth ? rectWidth : width / framesWidth;
|
|
73
|
-
optionsTextures.spriteHeight = rectHeight ? rectHeight : height / framesHeight;
|
|
74
|
-
this.animations.set(animationName, {
|
|
75
|
-
container: new Sprite(),
|
|
76
|
-
frames: this.createTextures(optionsTextures),
|
|
77
|
-
name: animationName,
|
|
78
|
-
animations: textures[animationName].animations,
|
|
79
|
-
params: [],
|
|
80
|
-
data: optionsTextures,
|
|
81
|
-
sprites: []
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
getSpriteSize(name) {
|
|
86
|
-
return this.animations.get(this.currentAnimation?.name || AnimationEnum.Stand)?.data[name] || 0;
|
|
87
|
-
}
|
|
88
|
-
getSpriteHeight() {
|
|
89
|
-
return this.getSpriteSize('spriteHeight');
|
|
90
|
-
}
|
|
91
|
-
getSpriteWidth() {
|
|
92
|
-
return this.getSpriteSize('spriteWidth');
|
|
93
|
-
}
|
|
94
|
-
has(name) {
|
|
95
|
-
return this.animations.has(name);
|
|
96
|
-
}
|
|
97
|
-
get(name) {
|
|
98
|
-
return this.animations.get(name);
|
|
99
|
-
}
|
|
100
|
-
isPlaying(name) {
|
|
101
|
-
if (!name)
|
|
102
|
-
return !!this.currentAnimation;
|
|
103
|
-
if (this.currentAnimation == null)
|
|
104
|
-
return false;
|
|
105
|
-
return this.currentAnimation.name == name;
|
|
106
|
-
}
|
|
107
|
-
stop() {
|
|
108
|
-
this.currentAnimation = null;
|
|
109
|
-
this.parent?.removeChild(this);
|
|
110
|
-
}
|
|
111
|
-
play(name, params = []) {
|
|
112
|
-
const animParams = this.currentAnimation?.params;
|
|
113
|
-
if (this.isPlaying(name) && arrayEquals(params, animParams || []))
|
|
114
|
-
return;
|
|
115
|
-
const animation = this.get(name);
|
|
116
|
-
if (!animation) {
|
|
117
|
-
throw new Error(`Impossible to play the ${name} animation because it doesn't exist on the ${this.id} spritesheet`);
|
|
118
|
-
}
|
|
119
|
-
this.removeChildren();
|
|
120
|
-
animation.sprites = [];
|
|
121
|
-
this.currentAnimation = animation;
|
|
122
|
-
this.currentAnimation.params = params;
|
|
123
|
-
this.time = 0;
|
|
124
|
-
this.frameIndex = 0;
|
|
125
|
-
let animations = animation.animations;
|
|
126
|
-
animations = isFunction(animations) ? animations(...params) : animations;
|
|
127
|
-
this.currentAnimation.container = new Container();
|
|
128
|
-
for (let container of animations) {
|
|
129
|
-
const sprite = new Sprite();
|
|
130
|
-
for (let frame of container) {
|
|
131
|
-
this.currentAnimation.sprites.push(frame);
|
|
132
|
-
}
|
|
133
|
-
this.currentAnimation.container.addChild(sprite);
|
|
134
|
-
}
|
|
135
|
-
const sound = this.currentAnimation.data.sound;
|
|
136
|
-
if (sound) {
|
|
137
|
-
RpgSound.get(sound).play();
|
|
138
|
-
}
|
|
139
|
-
this.addChild(this.currentAnimation.container);
|
|
140
|
-
// Updates immediately to avoid flickering
|
|
141
|
-
this.update(1);
|
|
142
|
-
}
|
|
143
|
-
update(deltaRatio) {
|
|
144
|
-
if (!this.isPlaying() || !this.currentAnimation)
|
|
145
|
-
return;
|
|
146
|
-
const { frames, container, sprites, data } = this.currentAnimation;
|
|
147
|
-
let frame = sprites[this.frameIndex];
|
|
148
|
-
const nextFrame = sprites[this.frameIndex + 1];
|
|
149
|
-
if (this.attachTo) {
|
|
150
|
-
const sprite = this.attachTo;
|
|
151
|
-
const pos = sprite?.getPositionsOfGraphic('middle');
|
|
152
|
-
if (pos) {
|
|
153
|
-
container.x = pos.x;
|
|
154
|
-
container.y = pos.y;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
for (let _sprite of container.children) {
|
|
158
|
-
const sprite = _sprite;
|
|
159
|
-
if (!frame || frame.frameY == undefined || frame.frameX == undefined) {
|
|
160
|
-
continue;
|
|
161
|
-
}
|
|
162
|
-
sprite.texture = frames[frame.frameY][frame.frameX];
|
|
163
|
-
const getVal = (prop) => frame[prop] || data[prop] || this.spritesheet[prop];
|
|
164
|
-
const applyTransform = (prop) => {
|
|
165
|
-
const val = getVal(prop);
|
|
166
|
-
if (val) {
|
|
167
|
-
sprite[prop].set(...val);
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
function applyTransformValue(prop, alias) {
|
|
171
|
-
const optionProp = alias || prop;
|
|
172
|
-
const val = getVal(optionProp);
|
|
173
|
-
if (val !== undefined) {
|
|
174
|
-
sprite[prop] = val;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
if (this.applyTransform) {
|
|
178
|
-
frame = {
|
|
179
|
-
...frame,
|
|
180
|
-
...this.applyTransform(frame, data, this.spritesheet)
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
const realSize = getVal('spriteRealSize');
|
|
184
|
-
const heightOfSprite = typeof realSize == 'number' ? realSize : realSize?.height;
|
|
185
|
-
const widthOfSprite = typeof realSize == 'number' ? realSize : realSize?.width;
|
|
186
|
-
const applyAnchorBySize = () => {
|
|
187
|
-
if (heightOfSprite && this.hitbox) {
|
|
188
|
-
const { spriteWidth, spriteHeight } = data;
|
|
189
|
-
const w = ((spriteWidth - this.hitbox.w) / 2) / spriteWidth;
|
|
190
|
-
const gap = (spriteHeight - heightOfSprite) / 2;
|
|
191
|
-
const h = (spriteHeight - this.hitbox.h - gap) / spriteHeight;
|
|
192
|
-
sprite.anchor.set(w, h);
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
if (frame.sound) {
|
|
196
|
-
RpgSound.get(frame.sound).play();
|
|
197
|
-
}
|
|
198
|
-
applyAnchorBySize();
|
|
199
|
-
applyTransform('anchor');
|
|
200
|
-
applyTransform('scale');
|
|
201
|
-
applyTransform('skew');
|
|
202
|
-
applyTransform('pivot');
|
|
203
|
-
applyTransformValue('alpha', 'opacity');
|
|
204
|
-
applyTransformValue('x');
|
|
205
|
-
applyTransformValue('y');
|
|
206
|
-
applyTransformValue('angle');
|
|
207
|
-
applyTransformValue('rotation');
|
|
208
|
-
applyTransformValue('visible');
|
|
209
|
-
this._animation$.next({
|
|
210
|
-
spriteWidth: widthOfSprite || sprite.width,
|
|
211
|
-
spriteHeight: heightOfSprite || sprite.height,
|
|
212
|
-
anchor: sprite.anchor,
|
|
213
|
-
width: getVal('spriteWidth'),
|
|
214
|
-
height: getVal('spriteHeight')
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
if (!nextFrame) {
|
|
218
|
-
this.time = 0;
|
|
219
|
-
this.frameIndex = 0;
|
|
220
|
-
if (this.attachTo) {
|
|
221
|
-
this.attachTo.animationIsPlaying = false;
|
|
222
|
-
}
|
|
223
|
-
if (this.onFinish)
|
|
224
|
-
this.onFinish();
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
this.time += deltaRatio;
|
|
228
|
-
if (this.time >= nextFrame.time) {
|
|
229
|
-
this.frameIndex++;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
//# sourceMappingURL=Animation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Animation.js","sourceRoot":"","sources":["../../src/Effects/Animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;A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ACZ;QAED,IAAI,CAAC,SAAS,EAAE;YACZ,IAAI,CAAC,IAAI,GAAG,CAAC,CAAA;YACb,IAAI,CAAC,UAAU,GAAG,CAAC,CAAA;YACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,IAAI,CAAC,QAAQ,CAAC,kBAAkB,GAAG,KAAK,CAAA;aAC3C;YACD,IAAI,IAAI,CAAC,QAAQ;gBAAE,IAAI,CAAC,QAAQ,EAAE,CAAA;YAClC,OAAM;SACT;QAED,IAAI,CAAC,IAAI,IAAI,UAAU,CAAA;QAEvB,IAAI,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE;YAC7B,IAAI,CAAC,UAAU,EAAE,CAAA;SACpB;IACL,CAAC;CACJ"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export var Animation;
|
|
2
|
-
(function (Animation) {
|
|
3
|
-
Animation["Stand"] = "stand";
|
|
4
|
-
Animation["Walk"] = "walk";
|
|
5
|
-
Animation["Attack"] = "attack";
|
|
6
|
-
Animation["Defense"] = "defense";
|
|
7
|
-
Animation["Skill"] = "skill";
|
|
8
|
-
})(Animation || (Animation = {}));
|
|
9
|
-
//# sourceMappingURL=AnimationCharacter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationCharacter.js","sourceRoot":"","sources":["../../src/Effects/AnimationCharacter.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACjB,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,4BAAe,CAAA;AACnB,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB"}
|
package/lib/Effects/Spinner.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RpgClientEngine } from "../RpgClientEngine.js";
|
|
2
|
-
import { Graphics, Renderer } from "pixi.js";
|
|
3
|
-
export declare class SpinnerGraphic extends Graphics {
|
|
4
|
-
private clientEngine;
|
|
5
|
-
constructor(clientEngine: RpgClientEngine);
|
|
6
|
-
render(renderer: Renderer): void;
|
|
7
|
-
}
|
package/lib/Effects/Spinner.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Graphics } from "pixi.js";
|
|
2
|
-
export class SpinnerGraphic extends Graphics {
|
|
3
|
-
constructor(clientEngine) {
|
|
4
|
-
super();
|
|
5
|
-
this.clientEngine = clientEngine;
|
|
6
|
-
}
|
|
7
|
-
render(renderer) {
|
|
8
|
-
super.render(renderer);
|
|
9
|
-
this.rotation += 0.12;
|
|
10
|
-
const percent = Math.abs(Math.sin(Date.now() / 1000));
|
|
11
|
-
this
|
|
12
|
-
.clear()
|
|
13
|
-
.lineStyle(4, 0xffffff, 1)
|
|
14
|
-
.moveTo(40, 0)
|
|
15
|
-
.arc(0, 0, 40, 0, Math.PI * 2 * percent, false);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=Spinner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../src/Effects/Spinner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAE7C,MAAM,OAAO,cAAe,SAAQ,QAAQ;IACxC,YAAoB,YAA6B;QAC7C,KAAK,EAAE,CAAA;QADS,iBAAY,GAAZ,YAAY,CAAiB;IAEjD,CAAC;IAED,MAAM,CAAC,QAAkB;QACrB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QACtB,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC;QACtB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAA;QACrD,IAAI;aACC,KAAK,EAAE;aACP,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;aACzB,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;aACb,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,CAAA;IACvD,CAAC;CACJ"}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { TransformOptions, FrameOptions } from '../Sprite/Spritesheet.js';
|
|
2
|
-
type EasingFunction = (time: number, _from: number, to: number, duration: number) => number;
|
|
3
|
-
export declare const Ease: Record<string, EasingFunction>;
|
|
4
|
-
type EaseType = (t: number, b: number, c: number, d: number) => number;
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new instance of the Timeline class, which allows for complex animations and control over keyframes.
|
|
7
|
-
*
|
|
8
|
-
* @constructor
|
|
9
|
-
* @title new Timeline(options?)
|
|
10
|
-
* @param {object} [options] - Optional configuration object for the Timeline.
|
|
11
|
-
* @param {number} [options.keyframes=10] - Specifies the number of keyframes for the animation. Defaults to 10. The larger the keyframes, the smoother the animation, but the more resource-intensive it is, as the loop to browse the array will take longer.
|
|
12
|
-
* @memberof Timeline
|
|
13
|
-
* @since 4.0.0
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* ```ts
|
|
17
|
-
* const timeline = new Timeline({ keyframes: 20 });
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
interface TimelineOptions {
|
|
21
|
-
keyframes?: number;
|
|
22
|
-
}
|
|
23
|
-
export declare class Timeline {
|
|
24
|
-
private time;
|
|
25
|
-
private animation;
|
|
26
|
-
private keyframes;
|
|
27
|
-
constructor(options?: TimelineOptions);
|
|
28
|
-
/**
|
|
29
|
-
* Allows you to create complex animations more easily. For example, to display a movement with an Easing function
|
|
30
|
-
*
|
|
31
|
-
* ```ts
|
|
32
|
-
* import { Timeline, Ease } from '@rpgjs/client'
|
|
33
|
-
*
|
|
34
|
-
* new Timeline()
|
|
35
|
-
* .add(30, ({ scale }) => [{
|
|
36
|
-
* frameX: 0,
|
|
37
|
-
* frameY: 1,
|
|
38
|
-
* scale: [scale]
|
|
39
|
-
* }], {
|
|
40
|
-
* scale: {
|
|
41
|
-
* from: 0,
|
|
42
|
-
* to: 1,
|
|
43
|
-
* easing: Ease.easeOutBounce
|
|
44
|
-
* }
|
|
45
|
-
* })
|
|
46
|
-
* .add(100)
|
|
47
|
-
* .create()
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* Here we say
|
|
51
|
-
*
|
|
52
|
-
* - Duration in frames, allowing you to specify the duration of each animation step. If the timeline respects a specific frame rate, e.g. 60 frames per second, 40 frames correspond to an animation duration of 2/3 of a second for each step.
|
|
53
|
-
* - A function that will be called every 1 frame with the `scale` property defined in transform
|
|
54
|
-
* - An object of transformation. Define the properties of your choice to be passed to the callback function
|
|
55
|
-
* - `to`: the starting value
|
|
56
|
-
* - `from`: the end value
|
|
57
|
-
* - `easing`: An easing function (By default, it is a linear function)
|
|
58
|
-
*
|
|
59
|
-
* Note that if you just put a duration (`add(100)`), it will only put a pause on the animation
|
|
60
|
-
*
|
|
61
|
-
* Easing functions available but you can create your own
|
|
62
|
-
*
|
|
63
|
-
* ```ts
|
|
64
|
-
* function myEase(t: number, b: number, c: number, d: number): number { }
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* `t`: current time
|
|
68
|
-
* `b`: start value
|
|
69
|
-
* `c`: end value
|
|
70
|
-
* `d`: duration
|
|
71
|
-
*
|
|
72
|
-
* @title Add Animation in timeline
|
|
73
|
-
* @enum {Function}
|
|
74
|
-
*
|
|
75
|
-
* Ease.linear | linear
|
|
76
|
-
* Ease.easeInQuad | easeInQuad
|
|
77
|
-
* Ease.easeOutQuad | easeOutQuad
|
|
78
|
-
* Ease.easeInOutQuad | easeInOutQuad
|
|
79
|
-
* Ease.easeInCubic | easeInCubic
|
|
80
|
-
* Ease.easeOutCubic | easeOutCubic
|
|
81
|
-
* Ease.easeInOutCubic | easeInOutCubic
|
|
82
|
-
* Ease.easeInQuart | easeInQuart
|
|
83
|
-
* Ease.easeOutQuart | easeOutQuart
|
|
84
|
-
* Ease.easeInOutQuart | easeInOutQuart
|
|
85
|
-
* Ease.easeInQuint | easeInQuint
|
|
86
|
-
* Ease.easeOutQuint | easeOutQuint
|
|
87
|
-
* Ease.easeInOutQuint | easeInOutQuint
|
|
88
|
-
* Ease.easeInSine | easeInSine
|
|
89
|
-
* Ease.easeOutSine | easeOutSine
|
|
90
|
-
* Ease.easeInOutSine | easeInOutSine
|
|
91
|
-
* Ease.easeInExpo | easeInExpo
|
|
92
|
-
* Ease.easeOutExpo | easeOutExpo
|
|
93
|
-
* Ease.easeInOutExpo | easeInOutExpo
|
|
94
|
-
* Ease.easeInCirc | easeInCirc
|
|
95
|
-
* Ease.easeOutCirc | easeOutCirc
|
|
96
|
-
* Ease.easeInOutCirc | easeInOutCirc
|
|
97
|
-
* Ease.easeInElastic | easeInElastic
|
|
98
|
-
* Ease.easeOutElastic | easeOutElastic
|
|
99
|
-
* Ease.easeInOutElastic | easeInOutElastic
|
|
100
|
-
* Ease.easeInBack | easeInBack
|
|
101
|
-
* Ease.easeOutBack | easeOutBack
|
|
102
|
-
* Ease.easeInOutBack | easeInOutBack
|
|
103
|
-
* Ease.easeInBounce | easeInBounce
|
|
104
|
-
* Ease.easeOutBounce | easeOutBounce
|
|
105
|
-
* @method timeline.add(duration,cb?,transform?)
|
|
106
|
-
* @param {number} duration
|
|
107
|
-
* @param { (obj?: number, time?: number) => TransformOptions[] } [cb]
|
|
108
|
-
* @param { [property: string]: { to:number, from: number: easing?: Function } } [transform]
|
|
109
|
-
* @returns {Timeline}
|
|
110
|
-
* @memberof Timeline
|
|
111
|
-
*/
|
|
112
|
-
add(duration: number, cb?: (obj?: any, time?: number) => TransformOptions[], transform?: {
|
|
113
|
-
[property: string]: {
|
|
114
|
-
to: number;
|
|
115
|
-
from: number;
|
|
116
|
-
easing?: EaseType;
|
|
117
|
-
};
|
|
118
|
-
}): Timeline;
|
|
119
|
-
/**
|
|
120
|
-
* Allows you to create the animation array to assign to the `animations` property in the Spritesheet
|
|
121
|
-
*
|
|
122
|
-
* ```ts
|
|
123
|
-
* import { Spritesheet, Timeline } from '@rpgjs/server'
|
|
124
|
-
*
|
|
125
|
-
* @Spritesheet({
|
|
126
|
-
* id: 'sprite',
|
|
127
|
-
* image: require('./sprite.png'),
|
|
128
|
-
* width: 192,
|
|
129
|
-
* height: 228,
|
|
130
|
-
* framesHeight: 6,
|
|
131
|
-
* framesWidth: 6,
|
|
132
|
-
* anchor: [0.5],
|
|
133
|
-
* textures: {
|
|
134
|
-
* myanim: {
|
|
135
|
-
* animations: new Timeline()
|
|
136
|
-
* .add(SEE THE ADD METHOD)
|
|
137
|
-
* .create()
|
|
138
|
-
* }
|
|
139
|
-
* }
|
|
140
|
-
* })
|
|
141
|
-
* export class MyAnim {}
|
|
142
|
-
* ```
|
|
143
|
-
*
|
|
144
|
-
* @title Create the animation array
|
|
145
|
-
* @method timeline.create()
|
|
146
|
-
* @returns {FrameOptions[][]} The animation array
|
|
147
|
-
* @memberof Timeline
|
|
148
|
-
*/
|
|
149
|
-
create(): FrameOptions[][];
|
|
150
|
-
}
|
|
151
|
-
export {};
|