bard-legends-framework 0.6.22 → 0.6.23
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/.eslintrc.js +1 -22
- package/dist/game-entities/entity/entity.d.ts +5 -1
- package/dist/game-entities/entity/entity.js +16 -4
- package/dist/game-entities/entity/entity.js.map +1 -1
- package/dist/pixi/game.d.ts +5 -1
- package/dist/pixi/game.js +11 -4
- package/dist/pixi/game.js.map +1 -1
- package/dist/pixi/index.d.ts +1 -0
- package/dist/pixi/index.js +4 -0
- package/dist/pixi/index.js.map +1 -1
- package/dist/pixi/modules/CAMERA/camera.d.ts +12 -0
- package/dist/pixi/modules/CAMERA/camera.js +32 -0
- package/dist/pixi/modules/CAMERA/camera.js.map +1 -0
- package/dist/pixi/modules/CAMERA/index.d.ts +2 -0
- package/dist/pixi/modules/CAMERA/index.js +8 -0
- package/dist/pixi/modules/CAMERA/index.js.map +1 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.d.ts +7 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.js +24 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.js.map +1 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera.gateway.d.ts +10 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera.gateway.js +30 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera.gateway.js.map +1 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.d.ts +5 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.js +36 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.js.map +1 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.d.ts +11 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.js +38 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.js.map +1 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.d.ts +15 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.js +17 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.js.map +1 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/index.d.ts +3 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/index.js +27 -0
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/index.js.map +1 -0
- package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.d.ts +11 -0
- package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.js +83 -0
- package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.js.map +1 -0
- package/dist/pixi/modules/CAMERA//360/237/247/212entities/camera.entity.d.ts +16 -0
- package/dist/pixi/modules/CAMERA//360/237/247/212entities/camera.entity.js +26 -0
- package/dist/pixi/modules/CAMERA//360/237/247/212entities/camera.entity.js.map +1 -0
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.d.ts +20 -0
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.js +94 -0
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.js.map +1 -0
- package/package.json +1 -2
- package/package.json.bak +1 -2
package/.eslintrc.js
CHANGED
|
@@ -24,31 +24,10 @@ module.exports = {
|
|
|
24
24
|
node: true,
|
|
25
25
|
jest: true
|
|
26
26
|
},
|
|
27
|
-
plugins: ['@typescript-eslint', '@typescript-eslint/eslint-plugin', 'no-null'
|
|
27
|
+
plugins: ['@typescript-eslint', '@typescript-eslint/eslint-plugin', 'no-null'],
|
|
28
28
|
ignorePatterns: ['**/*.js', 'vite.config.ts', 'out/**/*', 'dist/**/*', 'node_modules/**/*'],
|
|
29
29
|
rules: {
|
|
30
30
|
'no-null/no-null': 2,
|
|
31
|
-
'sort-class-members/sort-class-members': [
|
|
32
|
-
2,
|
|
33
|
-
{
|
|
34
|
-
order: [
|
|
35
|
-
'[static-properties]',
|
|
36
|
-
'[static-private-properties]',
|
|
37
|
-
'[static-methods]',
|
|
38
|
-
'[static-properties]',
|
|
39
|
-
'[static-private-properties]',
|
|
40
|
-
'[getters]',
|
|
41
|
-
'[setters]',
|
|
42
|
-
'[properties]',
|
|
43
|
-
'[conventional-private-properties]',
|
|
44
|
-
'constructor',
|
|
45
|
-
'[methods]',
|
|
46
|
-
'[conventional-private-properties]',
|
|
47
|
-
'[conventional-private-methods]'
|
|
48
|
-
],
|
|
49
|
-
accessorPairPositioning: 'getThenSet'
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
31
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
53
32
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
54
33
|
'@typescript-eslint/ban-types': 'error',
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Attachable } from '../attachable/attachable';
|
|
2
2
|
export type EntityClassType = new (...args: any[]) => Entity;
|
|
3
|
-
export
|
|
3
|
+
export interface EntityDecoratorMeta {
|
|
4
|
+
global: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function EntityDecorator(meta?: EntityDecoratorMeta): (EntityClass: EntityClassType) => any;
|
|
4
7
|
export declare abstract class Entity extends Attachable {
|
|
5
8
|
static getInstanceById<T extends Entity>(this: new (...args: any[]) => T, entityId: string | undefined): T | undefined;
|
|
6
9
|
static getInstanceByIdOrFail<T extends Entity>(this: new (...args: any[]) => T, entityId: string): T;
|
|
@@ -9,6 +12,7 @@ export declare abstract class Entity extends Attachable {
|
|
|
9
12
|
constructor();
|
|
10
13
|
protected destroySelf(): void;
|
|
11
14
|
attach(parent: Attachable | string): this;
|
|
15
|
+
skipAttachCheck(): this;
|
|
12
16
|
update(time: number, delta: number): void;
|
|
13
17
|
private updateTick;
|
|
14
18
|
}
|
|
@@ -5,10 +5,11 @@ const attachable_1 = require("../attachable/attachable");
|
|
|
5
5
|
const scene_1 = require("../scene/scene");
|
|
6
6
|
const entity_views_helper_1 = require("./helpers/entity-views.helper");
|
|
7
7
|
const entity_store_helper_1 = require("./helpers/entity-store.helper");
|
|
8
|
-
function EntityDecorator() {
|
|
8
|
+
function EntityDecorator(meta) {
|
|
9
9
|
return function (EntityClass) {
|
|
10
10
|
EntityClass.$meta = {
|
|
11
|
-
type: 'entity'
|
|
11
|
+
type: 'entity',
|
|
12
|
+
global: meta?.global ?? false
|
|
12
13
|
};
|
|
13
14
|
entity_store_helper_1.EntityStoreHelper.registerEntityClass(EntityClass);
|
|
14
15
|
};
|
|
@@ -33,13 +34,19 @@ class Entity extends attachable_1.Attachable {
|
|
|
33
34
|
constructor() {
|
|
34
35
|
super();
|
|
35
36
|
this.viewCreationHelper = new entity_views_helper_1.EntityViewsHelper(this);
|
|
36
|
-
|
|
37
|
+
let globalEntity = this.constructor.$meta.global;
|
|
38
|
+
if (!globalEntity) {
|
|
39
|
+
scene_1.Scene['registerEntity'](this);
|
|
40
|
+
}
|
|
37
41
|
entity_store_helper_1.EntityStoreHelper.registerEntity(this);
|
|
38
42
|
}
|
|
39
43
|
destroySelf() {
|
|
40
44
|
super.destroySelf();
|
|
41
45
|
this.viewCreationHelper.destroyViews();
|
|
42
|
-
|
|
46
|
+
let globalEntity = this.constructor.$meta.global;
|
|
47
|
+
if (!globalEntity) {
|
|
48
|
+
scene_1.Scene['unregisterEntity'](this);
|
|
49
|
+
}
|
|
43
50
|
entity_store_helper_1.EntityStoreHelper.unregisterEntity(this.constructor.name, this.id);
|
|
44
51
|
}
|
|
45
52
|
attach(parent) {
|
|
@@ -47,6 +54,11 @@ class Entity extends attachable_1.Attachable {
|
|
|
47
54
|
this.viewCreationHelper.createViews();
|
|
48
55
|
return this;
|
|
49
56
|
}
|
|
57
|
+
skipAttachCheck() {
|
|
58
|
+
super.skipAttachCheck();
|
|
59
|
+
this.viewCreationHelper.createViews();
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
50
62
|
update(time, delta) { }
|
|
51
63
|
// Triggered by Scene
|
|
52
64
|
updateTick(time, delta) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/game-entities/entity/entity.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AACtD,0CAAuC;AACvC,uEAAkE;AAClE,uEAAkE;
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/game-entities/entity/entity.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AACtD,0CAAuC;AACvC,uEAAkE;AAClE,uEAAkE;AAQlE,SAAgB,eAAe,CAAC,IAA0B;IACxD,OAAO,UAAU,WAA4B;QACrC,WAAY,CAAC,KAAK,GAAG;YACzB,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK;SAC9B,CAAC;QAEF,uCAAiB,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC;AATD,0CASC;AAED,MAAsB,MAAO,SAAQ,uBAAU;IAC7C,MAAM,CAAC,eAAe,CAAoD,QAA4B;QACpG,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,uCAAiB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAED,MAAM,CAAC,qBAAqB,CAAoD,QAAgB;QAC9F,IAAI,MAAM,GAAG,uCAAiB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACpE,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAI,CAAC,IAAI,WAAW,QAAQ,GAAG,CAAC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AY,EAAE,KAAa;QAC5C,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;CACF;AAhED,wBAgEC"}
|
package/dist/pixi/game.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { RGBColor, Vector } from 'helpers-lib';
|
|
|
2
2
|
import { Variable } from 'actions-lib';
|
|
3
3
|
import * as PIXI from 'pixi.js';
|
|
4
4
|
import { AssetDefinition, Container } from '.';
|
|
5
|
+
import { Camera } from './modules/CAMERA/camera';
|
|
5
6
|
export interface GameConfiguration {
|
|
6
7
|
screenResolution?: {
|
|
7
8
|
width: number;
|
|
@@ -11,14 +12,17 @@ export interface GameConfiguration {
|
|
|
11
12
|
devMode?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare class Game {
|
|
14
|
-
private static
|
|
15
|
+
private static _instance;
|
|
15
16
|
static get instance(): Game;
|
|
17
|
+
private static _camera;
|
|
18
|
+
static get camera(): Camera;
|
|
16
19
|
static get time(): number;
|
|
17
20
|
readonly stage: Container;
|
|
18
21
|
readonly renderer: PIXI.Renderer;
|
|
19
22
|
readonly screenSize: Variable<Vector>;
|
|
20
23
|
readonly screenSizeCenter: Variable<Vector>;
|
|
21
24
|
readonly devMode: boolean;
|
|
25
|
+
readonly backgroundColor: RGBColor;
|
|
22
26
|
private readonly pixiApp;
|
|
23
27
|
private readonly configuration;
|
|
24
28
|
private screenPositionToStagePositionConverter;
|
package/dist/pixi/game.js
CHANGED
|
@@ -31,9 +31,13 @@ const game_assets_1 = require("./helpers/game-assets");
|
|
|
31
31
|
const _1 = require(".");
|
|
32
32
|
const update_cycle_1 = require("../game-entities/update-cycle");
|
|
33
33
|
const position_conversion_helper_1 = require("./helpers/position-conversion.helper");
|
|
34
|
+
const camera_1 = require("./modules/CAMERA/camera");
|
|
34
35
|
class Game {
|
|
35
36
|
static get instance() {
|
|
36
|
-
return this.
|
|
37
|
+
return this._instance;
|
|
38
|
+
}
|
|
39
|
+
static get camera() {
|
|
40
|
+
return this._camera;
|
|
37
41
|
}
|
|
38
42
|
static get time() {
|
|
39
43
|
return update_cycle_1.UpdateCycle['time'];
|
|
@@ -43,14 +47,15 @@ class Game {
|
|
|
43
47
|
this.screenSizeCenter = new actions_lib_1.Variable();
|
|
44
48
|
this.devMode = false;
|
|
45
49
|
this.resetScreenPositionToStagePositionFunction();
|
|
46
|
-
if (Game.
|
|
50
|
+
if (Game._instance) {
|
|
47
51
|
throw new Error('There can be only one Game instance!');
|
|
48
52
|
}
|
|
49
53
|
else {
|
|
50
54
|
this.configuration = this.completePartialConfiguration(partialConfiguration);
|
|
51
55
|
this.devMode = this.configuration.devMode || false;
|
|
56
|
+
this.backgroundColor = this.configuration.backgroundColor;
|
|
52
57
|
this.pixiApp = new PIXI.Application({
|
|
53
|
-
backgroundColor:
|
|
58
|
+
backgroundColor: helpers_lib_1.ColorHelper.black,
|
|
54
59
|
autoStart: false,
|
|
55
60
|
antialias: true,
|
|
56
61
|
resolution: 1,
|
|
@@ -63,7 +68,7 @@ class Game {
|
|
|
63
68
|
async setup(assetDefinitions) {
|
|
64
69
|
document.body.appendChild(this.pixiApp.view);
|
|
65
70
|
await Promise.all([game_assets_1.GameAssets.loadGameAssets(assetDefinitions)]);
|
|
66
|
-
Game.
|
|
71
|
+
Game._instance = this;
|
|
67
72
|
// @ts-ignore
|
|
68
73
|
this.stage = new _1.Container().skipAttachCheck();
|
|
69
74
|
// @ts-ignore
|
|
@@ -79,6 +84,8 @@ class Game {
|
|
|
79
84
|
// Wait until pixijs adjusts the screen size
|
|
80
85
|
setTimeout(() => this.setScreenSize());
|
|
81
86
|
});
|
|
87
|
+
Game._camera = new camera_1.Camera();
|
|
88
|
+
await Game._camera.setup();
|
|
82
89
|
this.pixiApp.start();
|
|
83
90
|
this.pixiApp.ticker.add(() => {
|
|
84
91
|
update_cycle_1.UpdateCycle.triggerUpdateTick(this.pixiApp.ticker.deltaMS);
|
package/dist/pixi/game.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game.js","sourceRoot":"","sources":["../../src/pixi/game.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"game.js","sourceRoot":"","sources":["../../src/pixi/game.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA4D;AAC5D,6CAAuC;AACvC,8CAAgC;AAEhC,uDAAmD;AACnD,wBAA+C;AAC/C,gEAA4D;AAC5D,qFAAgF;AAChF,oDAAiD;AAQjD,MAAa,IAAI;IAEf,MAAM,KAAK,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD,MAAM,KAAK,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,MAAM,KAAK,IAAI;QACb,OAAO,0BAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAeD,YAAY,oBAAiD;QAVpD,eAAU,GAAG,IAAI,sBAAQ,EAAU,CAAC;QACpC,qBAAgB,GAAG,IAAI,sBAAQ,EAAU,CAAC;QAC1C,YAAO,GAAY,KAAK,CAAC;QAShC,IAAI,CAAC,0CAA0C,EAAE,CAAC;QAElD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,4BAA4B,CAAC,oBAAoB,CAAC,CAAC;YAE7E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,KAAK,CAAC;YACnD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,eA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EAAE,GAAG,oBAAoB,EAAE,CAAC;QAChE,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;IAEO,aAAa;QACnB,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,IAAI,oBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC1F,IAAI,CAAC,gBAAgB,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAC1E,CAAC;CACF;AAzHD,oBAyHC"}
|
package/dist/pixi/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { KeyboardService } from './services/keyboard/keyboard';
|
|
|
9
9
|
export { MouseService } from './services/mouse/mouse.service';
|
|
10
10
|
export { MouseTargetFocusService } from './services/mouse/mouse-target-focus.service';
|
|
11
11
|
export { PositionConversionHelper } from './helpers/position-conversion.helper';
|
|
12
|
+
export * from './modules/CAMERA';
|
|
12
13
|
export interface AssetDefinition<T extends string = string> {
|
|
13
14
|
name: string;
|
|
14
15
|
url: T;
|
package/dist/pixi/index.js
CHANGED
|
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.BlendMode = exports.PositionConversionHelper = exports.MouseTargetFocusService = exports.MouseService = exports.KeyboardService = exports.Text = exports.Graphics = exports.Sprite = exports.Container = exports.Cursor = exports.ContainerEventType = exports.Game = void 0;
|
|
27
30
|
const PIXI = __importStar(require("pixi.js"));
|
|
@@ -46,6 +49,7 @@ var mouse_target_focus_service_1 = require("./services/mouse/mouse-target-focus.
|
|
|
46
49
|
Object.defineProperty(exports, "MouseTargetFocusService", { enumerable: true, get: function () { return mouse_target_focus_service_1.MouseTargetFocusService; } });
|
|
47
50
|
var position_conversion_helper_1 = require("./helpers/position-conversion.helper");
|
|
48
51
|
Object.defineProperty(exports, "PositionConversionHelper", { enumerable: true, get: function () { return position_conversion_helper_1.PositionConversionHelper; } });
|
|
52
|
+
__exportStar(require("./modules/CAMERA"), exports);
|
|
49
53
|
var BlendMode;
|
|
50
54
|
(function (BlendMode) {
|
|
51
55
|
BlendMode[BlendMode["normal"] = 0] = "normal";
|
package/dist/pixi/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pixi/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pixi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8CAAgC;AAEhC,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,8EAAmF;AAA1E,0HAAA,kBAAkB,OAAA;AAAE,8GAAA,MAAM,OAAA;AACnC,wDAAyE;AAAhE,sGAAA,SAAS,OAAA;AAClB,0DAAyD;AAAhD,gGAAA,MAAM,OAAA;AACf,8DAA6D;AAApD,oGAAA,QAAQ,OAAA;AACjB,sDAAsF;AAA7E,4FAAA,IAAI,OAAA;AACb,yDAA+D;AAAtD,2GAAA,eAAe,OAAA;AACxB,gEAA8D;AAArD,6GAAA,YAAY,OAAA;AACrB,0FAAsF;AAA7E,qIAAA,uBAAuB,OAAA;AAChC,mFAAgF;AAAvE,sIAAA,wBAAwB,OAAA;AACjC,mDAAiC;AASjC,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,6CAAgC,CAAA;IAChC,uCAA0B,CAAA;IAC1B,6CAAgC,CAAA;IAChC,sDAAwC,CAAA;AAC1C,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Vector } from 'helpers-lib';
|
|
2
|
+
import { CameraLayer, FocusingOptions } from './⚜️gateways';
|
|
3
|
+
export declare class Camera {
|
|
4
|
+
readonly layers: Record<CameraLayer, string>;
|
|
5
|
+
private cameraGateway;
|
|
6
|
+
private cameraViewGateway;
|
|
7
|
+
get position(): Vector;
|
|
8
|
+
constructor();
|
|
9
|
+
setup(): Promise<void>;
|
|
10
|
+
setPosition(position: Vector, options?: FocusingOptions): void;
|
|
11
|
+
appear(on: boolean): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Camera = void 0;
|
|
4
|
+
const game_entities_1 = require("../../../game-entities");
|
|
5
|
+
const __gateways_1 = require("./\u269C\uFE0Fgateways");
|
|
6
|
+
class Camera {
|
|
7
|
+
get position() {
|
|
8
|
+
return this.cameraGateway.getCameraPosition();
|
|
9
|
+
}
|
|
10
|
+
constructor() {
|
|
11
|
+
this.cameraGateway = game_entities_1.Service.get(__gateways_1.CameraGateway);
|
|
12
|
+
this.cameraViewGateway = game_entities_1.Service.get(__gateways_1.CameraViewGateway);
|
|
13
|
+
this.cameraGateway.createCamera();
|
|
14
|
+
}
|
|
15
|
+
async setup() {
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
this.layers = await this.cameraViewGateway.getLayers();
|
|
18
|
+
game_entities_1.UpdateCycle.beforeSceneUpdateAction
|
|
19
|
+
.subscribe(({ time, delta }) => {
|
|
20
|
+
this.cameraGateway.update(time, delta);
|
|
21
|
+
})
|
|
22
|
+
.skipAttachCheck();
|
|
23
|
+
}
|
|
24
|
+
setPosition(position, options) {
|
|
25
|
+
this.cameraGateway.setPosition(position, options);
|
|
26
|
+
}
|
|
27
|
+
async appear(on) {
|
|
28
|
+
return this.cameraViewGateway.appear(on);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.Camera = Camera;
|
|
32
|
+
//# sourceMappingURL=camera.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../../../../src/pixi/modules/CAMERA/camera.ts"],"names":[],"mappings":";;;AAEA,0DAA8D;AAC9D,uDAA8F;AAE9F,MAAa,MAAM;IAMjB,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC;IAChD,CAAC;IAED;QACE,IAAI,CAAC,aAAa,GAAG,uBAAO,CAAC,GAAG,CAAC,0BAAa,CAAC,CAAC;QAChD,IAAI,CAAC,iBAAiB,GAAG,uBAAO,CAAC,GAAG,CAAC,8BAAiB,CAAC,CAAC;QAExD,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,aAAa;QACb,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;QACvD,2BAAW,CAAC,uBAAuB;aAChC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;YAC7B,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzC,CAAC,CAAC;aACD,eAAe,EAAE,CAAC;IACvB,CAAC;IAED,WAAW,CAAC,QAAgB,EAAE,OAAyB;QACrD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAW;QACtB,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;CACF;AAlCD,wBAkCC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FocusingAnimation = exports.Camera = void 0;
|
|
4
|
+
var camera_1 = require("./camera");
|
|
5
|
+
Object.defineProperty(exports, "Camera", { enumerable: true, get: function () { return camera_1.Camera; } });
|
|
6
|
+
var __gateways_1 = require("./\u269C\uFE0Fgateways");
|
|
7
|
+
Object.defineProperty(exports, "FocusingAnimation", { enumerable: true, get: function () { return __gateways_1.FocusingAnimation; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pixi/modules/CAMERA/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,qDAAiD;AAAxC,+GAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ControllerLink } from '../../../../game-entities';
|
|
2
|
+
import { CameraLayer } from './dtos/requests.dto';
|
|
3
|
+
export declare const CameraViewControllerLink: ControllerLink;
|
|
4
|
+
export declare class CameraViewGateway {
|
|
5
|
+
getLayers(): Promise<Record<CameraLayer, string>>;
|
|
6
|
+
appear(on: boolean): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CameraViewGateway = exports.CameraViewControllerLink = void 0;
|
|
10
|
+
const game_entities_1 = require("../../../../game-entities");
|
|
11
|
+
exports.CameraViewControllerLink = new game_entities_1.ControllerLink();
|
|
12
|
+
let CameraViewGateway = class CameraViewGateway {
|
|
13
|
+
async getLayers() {
|
|
14
|
+
return exports.CameraViewControllerLink.trigger('getLayers');
|
|
15
|
+
}
|
|
16
|
+
async appear(on) {
|
|
17
|
+
return exports.CameraViewControllerLink.trigger('appear', on);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.CameraViewGateway = CameraViewGateway;
|
|
21
|
+
exports.CameraViewGateway = CameraViewGateway = __decorate([
|
|
22
|
+
(0, game_entities_1.ServiceDecorator)()
|
|
23
|
+
], CameraViewGateway);
|
|
24
|
+
//# sourceMappingURL=camera-view.gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-view.gateway.js","sourceRoot":"","sources":["../../../../../src/pixi/modules/CAMERA/⚜️gateways/camera-view.gateway.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6DAA6E;AAGhE,QAAA,wBAAwB,GAAG,IAAI,8BAAc,EAAE,CAAC;AAGtD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,KAAK,CAAC,SAAS;QACb,OAAO,gCAAwB,CAAC,OAAO,CAA8B,WAAW,CAAC,CAAC;IACpF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAW;QACtB,OAAO,gCAAwB,CAAC,OAAO,CAAO,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AARY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,gCAAgB,GAAE;GACN,iBAAiB,CAQ7B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Vector } from 'helpers-lib';
|
|
2
|
+
import { ControllerLink } from '../../../../game-entities';
|
|
3
|
+
import { FocusingOptions } from './dtos/requests.dto';
|
|
4
|
+
export declare const CameraControllerLink: ControllerLink;
|
|
5
|
+
export declare class CameraGateway {
|
|
6
|
+
createCamera(): string;
|
|
7
|
+
update(time: number, delta: number): void;
|
|
8
|
+
setPosition(position: Vector, options?: FocusingOptions): void;
|
|
9
|
+
getCameraPosition(): Vector;
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CameraGateway = exports.CameraControllerLink = void 0;
|
|
10
|
+
const game_entities_1 = require("../../../../game-entities");
|
|
11
|
+
exports.CameraControllerLink = new game_entities_1.ControllerLink();
|
|
12
|
+
let CameraGateway = class CameraGateway {
|
|
13
|
+
createCamera() {
|
|
14
|
+
return exports.CameraControllerLink.trigger('createCamera');
|
|
15
|
+
}
|
|
16
|
+
update(time, delta) {
|
|
17
|
+
return exports.CameraControllerLink.trigger('update', time, delta);
|
|
18
|
+
}
|
|
19
|
+
setPosition(position, options) {
|
|
20
|
+
return exports.CameraControllerLink.trigger('setPosition', position, options);
|
|
21
|
+
}
|
|
22
|
+
getCameraPosition() {
|
|
23
|
+
return exports.CameraControllerLink.trigger('getCameraPosition');
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.CameraGateway = CameraGateway;
|
|
27
|
+
exports.CameraGateway = CameraGateway = __decorate([
|
|
28
|
+
(0, game_entities_1.ServiceDecorator)()
|
|
29
|
+
], CameraGateway);
|
|
30
|
+
//# sourceMappingURL=camera.gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.gateway.js","sourceRoot":"","sources":["../../../../../src/pixi/modules/CAMERA/⚜️gateways/camera.gateway.ts"],"names":[],"mappings":";;;;;;;;;AAEA,6DAA6E;AAGhE,QAAA,oBAAoB,GAAG,IAAI,8BAAc,EAAE,CAAC;AAGlD,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAAY;QACV,OAAO,4BAAoB,CAAC,OAAO,CAAS,cAAc,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,KAAa;QAChC,OAAO,4BAAoB,CAAC,OAAO,CAAO,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;IAED,WAAW,CAAC,QAAgB,EAAE,OAAyB;QACrD,OAAO,4BAAoB,CAAC,OAAO,CAAO,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED,iBAAiB;QACf,OAAO,4BAAoB,CAAC,OAAO,CAAS,mBAAmB,CAAC,CAAC;IACnE,CAAC;CACF,CAAA;AAhBY,sCAAa;wBAAb,aAAa;IADzB,IAAA,gCAAgB,GAAE;GACN,aAAa,CAgBzB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CameraViewController = void 0;
|
|
10
|
+
const camera_view_gateway_1 = require("../camera-view.gateway");
|
|
11
|
+
const camera_entity_1 = require("../../\uD83E\uDDCAentities/camera.entity");
|
|
12
|
+
const camera_view_1 = require("../../\uD83E\uDDE9views/camera.view");
|
|
13
|
+
const game_entities_1 = require("../../../../../game-entities");
|
|
14
|
+
const requests_dto_1 = require("../dtos/requests.dto");
|
|
15
|
+
let CameraViewController = class CameraViewController {
|
|
16
|
+
async getLayers() {
|
|
17
|
+
let cameraEntityId = camera_entity_1.CameraEntity.getInstanceOrFail().id;
|
|
18
|
+
let cameraView = await camera_view_1.CameraView.getInstanceOrFail(cameraEntityId);
|
|
19
|
+
return {
|
|
20
|
+
background: cameraView.getLayerId(requests_dto_1.CameraLayer.background),
|
|
21
|
+
main: cameraView.getLayerId(requests_dto_1.CameraLayer.main),
|
|
22
|
+
foreground: cameraView.getLayerId(requests_dto_1.CameraLayer.foreground),
|
|
23
|
+
ui: cameraView.getLayerId(requests_dto_1.CameraLayer.ui)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async appear(on) {
|
|
27
|
+
let cameraEntityId = camera_entity_1.CameraEntity.getInstanceOrFail().id;
|
|
28
|
+
let cameraView = await camera_view_1.CameraView.getInstanceOrFail(cameraEntityId);
|
|
29
|
+
return cameraView.appear(on);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.CameraViewController = CameraViewController;
|
|
33
|
+
exports.CameraViewController = CameraViewController = __decorate([
|
|
34
|
+
(0, game_entities_1.ControllerDecorator)({ controllerLink: camera_view_gateway_1.CameraViewControllerLink })
|
|
35
|
+
], CameraViewController);
|
|
36
|
+
//# sourceMappingURL=camera-view.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-view.controller.js","sourceRoot":"","sources":["../../../../../../src/pixi/modules/CAMERA/⚜️gateways/controllers/camera-view.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gEAAkE;AAClE,4EAA8D;AAC9D,qEAAuD;AACvD,gEAAmE;AACnE,uDAAmD;AAG5C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,KAAK,CAAC,SAAS;QACb,IAAI,cAAc,GAAG,4BAAY,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC;QACzD,IAAI,UAAU,GAAG,MAAM,wBAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;QAEpE,OAAO;YACL,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,0BAAW,CAAC,UAAU,CAAC;YACzD,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,0BAAW,CAAC,IAAI,CAAC;YAC7C,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,0BAAW,CAAC,UAAU,CAAC;YACzD,EAAE,EAAE,UAAU,CAAC,UAAU,CAAC,0BAAW,CAAC,EAAE,CAAC;SAC1C,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAW;QACtB,IAAI,cAAc,GAAG,4BAAY,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC;QACzD,IAAI,UAAU,GAAG,MAAM,wBAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;QACpE,OAAO,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF,CAAA;AAlBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mCAAmB,EAAC,EAAE,cAAc,EAAE,8CAAwB,EAAE,CAAC;GACrD,oBAAoB,CAkBhC"}
|
package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Vector } from 'helpers-lib';
|
|
2
|
+
import { CameraService } from '../../📐services/camera.service';
|
|
3
|
+
import { FocusingOptions } from '../dtos/requests.dto';
|
|
4
|
+
export declare class CameraController {
|
|
5
|
+
private cameraService;
|
|
6
|
+
constructor(cameraService: CameraService);
|
|
7
|
+
createCamera(): string;
|
|
8
|
+
update(time: number, delta: number): void;
|
|
9
|
+
setPosition(position: Vector, options?: FocusingOptions): void;
|
|
10
|
+
getCameraPosition(): Vector;
|
|
11
|
+
}
|
package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CameraController = void 0;
|
|
13
|
+
const game_entities_1 = require("../../../../../game-entities");
|
|
14
|
+
const camera_gateway_1 = require("../camera.gateway");
|
|
15
|
+
const camera_service_1 = require("../../\uD83D\uDCD0services/camera.service");
|
|
16
|
+
let CameraController = class CameraController {
|
|
17
|
+
constructor(cameraService) {
|
|
18
|
+
this.cameraService = cameraService;
|
|
19
|
+
}
|
|
20
|
+
createCamera() {
|
|
21
|
+
return this.cameraService.createCamera().id;
|
|
22
|
+
}
|
|
23
|
+
update(time, delta) {
|
|
24
|
+
this.cameraService.update(time, delta);
|
|
25
|
+
}
|
|
26
|
+
setPosition(position, options) {
|
|
27
|
+
this.cameraService.setPosition(position, options);
|
|
28
|
+
}
|
|
29
|
+
getCameraPosition() {
|
|
30
|
+
return this.cameraService.getCameraPosition();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.CameraController = CameraController;
|
|
34
|
+
exports.CameraController = CameraController = __decorate([
|
|
35
|
+
(0, game_entities_1.ControllerDecorator)({ controllerLink: camera_gateway_1.CameraControllerLink }),
|
|
36
|
+
__metadata("design:paramtypes", [camera_service_1.CameraService])
|
|
37
|
+
], CameraController);
|
|
38
|
+
//# sourceMappingURL=camera.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.controller.js","sourceRoot":"","sources":["../../../../../../src/pixi/modules/CAMERA/⚜️gateways/controllers/camera.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gEAAmE;AACnE,sDAAyD;AACzD,8EAAgE;AAIzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEpD,YAAY;QACV,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,KAAa;QAChC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,WAAW,CAAC,QAAgB,EAAE,OAAyB;QACrD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC;IAChD,CAAC;CACF,CAAA;AAlBY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mCAAmB,EAAC,EAAE,cAAc,EAAE,qCAAoB,EAAE,CAAC;qCAEzB,8BAAa;GADrC,gBAAgB,CAkB5B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum CameraLayer {
|
|
2
|
+
background = "background",
|
|
3
|
+
main = "main",
|
|
4
|
+
foreground = "foreground",
|
|
5
|
+
ui = "ui"
|
|
6
|
+
}
|
|
7
|
+
export declare enum FocusingAnimation {
|
|
8
|
+
instant = "instant",
|
|
9
|
+
easeInOut = "easeInOut",
|
|
10
|
+
easeOut = "easeOut"
|
|
11
|
+
}
|
|
12
|
+
export interface FocusingOptions {
|
|
13
|
+
duration?: number;
|
|
14
|
+
animation?: FocusingAnimation;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FocusingAnimation = exports.CameraLayer = void 0;
|
|
4
|
+
var CameraLayer;
|
|
5
|
+
(function (CameraLayer) {
|
|
6
|
+
CameraLayer["background"] = "background";
|
|
7
|
+
CameraLayer["main"] = "main";
|
|
8
|
+
CameraLayer["foreground"] = "foreground";
|
|
9
|
+
CameraLayer["ui"] = "ui";
|
|
10
|
+
})(CameraLayer || (exports.CameraLayer = CameraLayer = {}));
|
|
11
|
+
var FocusingAnimation;
|
|
12
|
+
(function (FocusingAnimation) {
|
|
13
|
+
FocusingAnimation["instant"] = "instant";
|
|
14
|
+
FocusingAnimation["easeInOut"] = "easeInOut";
|
|
15
|
+
FocusingAnimation["easeOut"] = "easeOut";
|
|
16
|
+
})(FocusingAnimation || (exports.FocusingAnimation = FocusingAnimation = {}));
|
|
17
|
+
//# sourceMappingURL=requests.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.dto.js","sourceRoot":"","sources":["../../../../../../src/pixi/modules/CAMERA/⚜️gateways/dtos/requests.dto.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,wBAAS,CAAA;AACX,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;AACrB,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.CameraViewGateway = exports.CameraGateway = void 0;
|
|
18
|
+
var camera_gateway_1 = require("./camera.gateway");
|
|
19
|
+
Object.defineProperty(exports, "CameraGateway", { enumerable: true, get: function () { return camera_gateway_1.CameraGateway; } });
|
|
20
|
+
var camera_view_gateway_1 = require("./camera-view.gateway");
|
|
21
|
+
Object.defineProperty(exports, "CameraViewGateway", { enumerable: true, get: function () { return camera_view_gateway_1.CameraViewGateway; } });
|
|
22
|
+
__exportStar(require("./dtos/requests.dto"), exports);
|
|
23
|
+
const camera_controller_1 = require("./controllers/camera.controller");
|
|
24
|
+
const camera_view_controller_1 = require("./controllers/camera-view.controller");
|
|
25
|
+
const camera_view_1 = require("../\uD83E\uDDE9views/camera.view");
|
|
26
|
+
camera_controller_1.CameraController && camera_view_controller_1.CameraViewController && camera_view_1.CameraView;
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/pixi/modules/CAMERA/⚜️gateways/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAE1B,sDAAoC;AAEpC,uEAAmE;AACnE,iFAA4E;AAC5E,kEAAoD;AACpD,oCAAgB,IAAI,6CAAoB,IAAI,wBAAU,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Vector } from 'helpers-lib';
|
|
2
|
+
import { FocusingOptions } from '../⚜️gateways';
|
|
3
|
+
import { CameraEntity } from '../🧊entities/camera.entity';
|
|
4
|
+
export declare class CameraService {
|
|
5
|
+
createCamera(): CameraEntity;
|
|
6
|
+
getCameraPosition(): Vector;
|
|
7
|
+
setPosition(position: Vector, options?: FocusingOptions): void;
|
|
8
|
+
update(time: number, delta: number): void;
|
|
9
|
+
private iterateOnFocusingNewTarget;
|
|
10
|
+
private completeFocusingNewTarget;
|
|
11
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CameraService = void 0;
|
|
10
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
11
|
+
const __gateways_1 = require("../\u269C\uFE0Fgateways");
|
|
12
|
+
const camera_entity_1 = require("../\uD83E\uDDCAentities/camera.entity");
|
|
13
|
+
const game_entities_1 = require("../../../../game-entities");
|
|
14
|
+
const utilities_1 = require("../../../../utilities");
|
|
15
|
+
const game_1 = require("../../../game");
|
|
16
|
+
const FOCUS_ANIMATION_DURATION = 1500;
|
|
17
|
+
let CameraService = class CameraService {
|
|
18
|
+
createCamera() {
|
|
19
|
+
return new camera_entity_1.CameraEntity().skipAttachCheck();
|
|
20
|
+
}
|
|
21
|
+
getCameraPosition() {
|
|
22
|
+
let cameraEntity = camera_entity_1.CameraEntity.getInstanceOrFail();
|
|
23
|
+
return helpers_lib_1.Vector.fromTo(cameraEntity.offset.value, cameraEntity.position.value);
|
|
24
|
+
}
|
|
25
|
+
setPosition(position, options) {
|
|
26
|
+
let cameraEntity = camera_entity_1.CameraEntity.getInstanceOrFail();
|
|
27
|
+
cameraEntity.targetPosition.value = position;
|
|
28
|
+
if (options) {
|
|
29
|
+
cameraEntity.focusingNewTargetInfo.value = {
|
|
30
|
+
time: game_1.Game.time,
|
|
31
|
+
duration: options?.duration ?? FOCUS_ANIMATION_DURATION,
|
|
32
|
+
position: cameraEntity.position.value,
|
|
33
|
+
focusingAnimation: options?.animation ?? __gateways_1.FocusingAnimation.instant
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
update(time, delta) {
|
|
38
|
+
let cameraEntity = camera_entity_1.CameraEntity.getInstanceOrFail();
|
|
39
|
+
let targetPosition = cameraEntity.targetPosition.value;
|
|
40
|
+
if (targetPosition) {
|
|
41
|
+
if (cameraEntity.focusingNewTargetInfo.value) {
|
|
42
|
+
this.iterateOnFocusingNewTarget(cameraEntity, targetPosition, time);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
cameraEntity.position.value = targetPosition;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
iterateOnFocusingNewTarget(cameraEntity, targetPosition, time) {
|
|
50
|
+
let focusingNewTargetInfo = cameraEntity.focusingNewTargetInfo.value;
|
|
51
|
+
if (focusingNewTargetInfo.focusingAnimation === __gateways_1.FocusingAnimation.instant) {
|
|
52
|
+
this.completeFocusingNewTarget(cameraEntity, targetPosition);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
let animationTime = (time - focusingNewTargetInfo.time) / focusingNewTargetInfo.duration;
|
|
56
|
+
if (animationTime >= 1) {
|
|
57
|
+
this.completeFocusingNewTarget(cameraEntity, targetPosition);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
let interpolatedTime;
|
|
61
|
+
if (focusingNewTargetInfo.focusingAnimation === __gateways_1.FocusingAnimation.easeInOut) {
|
|
62
|
+
interpolatedTime = utilities_1.AnimationInterpolationFunctions.easeInOut(animationTime);
|
|
63
|
+
}
|
|
64
|
+
else if (focusingNewTargetInfo.focusingAnimation === __gateways_1.FocusingAnimation.easeOut) {
|
|
65
|
+
interpolatedTime = utilities_1.AnimationInterpolationFunctions.easeOut(animationTime);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
interpolatedTime = 1;
|
|
69
|
+
}
|
|
70
|
+
cameraEntity.position.value = focusingNewTargetInfo.position.lerp(targetPosition, interpolatedTime);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
completeFocusingNewTarget(cameraEntity, targetPosition) {
|
|
75
|
+
cameraEntity.position.value = targetPosition;
|
|
76
|
+
cameraEntity.focusingNewTargetInfo.value = undefined;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.CameraService = CameraService;
|
|
80
|
+
exports.CameraService = CameraService = __decorate([
|
|
81
|
+
(0, game_entities_1.ServiceDecorator)()
|
|
82
|
+
], CameraService);
|
|
83
|
+
//# sourceMappingURL=camera.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.service.js","sourceRoot":"","sources":["../../../../../src/pixi/modules/CAMERA/📐services/camera.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6CAAqC;AAErC,wDAAmE;AACnE,yEAA2D;AAC3D,6DAA6D;AAC7D,qDAAwE;AACxE,wCAAqC;AAErC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAG/B,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAAY;QACV,OAAO,IAAI,4BAAY,EAAE,CAAC,eAAe,EAAE,CAAC;IAC9C,CAAC;IAED,iBAAiB;QACf,IAAI,YAAY,GAAG,4BAAY,CAAC,iBAAiB,EAAE,CAAC;QACpD,OAAO,oBAAM,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC;IAED,WAAW,CAAC,QAAgB,EAAE,OAAyB;QACrD,IAAI,YAAY,GAAG,4BAAY,CAAC,iBAAiB,EAAE,CAAC;QAEpD,YAAY,CAAC,cAAc,CAAC,KAAK,GAAG,QAAQ,CAAC;QAC7C,IAAI,OAAO,EAAE,CAAC;YACZ,YAAY,CAAC,qBAAqB,CAAC,KAAK,GAAG;gBACzC,IAAI,EAAE,WAAI,CAAC,IAAI;gBACf,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,wBAAwB;gBACvD,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,KAAK;gBACrC,iBAAiB,EAAE,OAAO,EAAE,SAAS,IAAI,8BAAiB,CAAC,OAAO;aACnE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,KAAa;QAChC,IAAI,YAAY,GAAG,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AM,CAAC;oBACN,gBAAgB,GAAG,CAAC,CAAC;gBACvB,CAAC;gBAED,YAAY,CAAC,QAAQ,CAAC,KAAK,GAAG,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;YACtG,CAAC;QACH,CAAC;IACH,CAAC;IAEO,yBAAyB,CAAC,YAA0B,EAAE,cAAsB;QAClF,YAAY,CAAC,QAAQ,CAAC,KAAK,GAAG,cAAc,CAAC;QAC7C,YAAY,CAAC,qBAAqB,CAAC,KAAK,GAAG,SAAS,CAAC;IACvD,CAAC;CACF,CAAA;AAlEY,sCAAa;wBAAb,aAAa;IADzB,IAAA,gCAAgB,GAAE;GACN,aAAa,CAkEzB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Variable } from 'actions-lib';
|
|
2
|
+
import { Vector } from 'helpers-lib';
|
|
3
|
+
import { FocusingAnimation } from '../⚜️gateways';
|
|
4
|
+
import { SingletonEntity } from '../../../../game-entities';
|
|
5
|
+
export interface FocusingNewTargetInfo {
|
|
6
|
+
time: number;
|
|
7
|
+
duration: number;
|
|
8
|
+
position: Vector;
|
|
9
|
+
focusingAnimation: FocusingAnimation;
|
|
10
|
+
}
|
|
11
|
+
export declare class CameraEntity extends SingletonEntity {
|
|
12
|
+
readonly position: Variable<Vector>;
|
|
13
|
+
readonly offset: Variable<Vector>;
|
|
14
|
+
readonly targetPosition: Variable<Vector | undefined>;
|
|
15
|
+
readonly focusingNewTargetInfo: Variable<FocusingNewTargetInfo | undefined>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CameraEntity = void 0;
|
|
10
|
+
const actions_lib_1 = require("actions-lib");
|
|
11
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
12
|
+
const game_entities_1 = require("../../../../game-entities");
|
|
13
|
+
let CameraEntity = class CameraEntity extends game_entities_1.SingletonEntity {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.position = new actions_lib_1.Variable().set(helpers_lib_1.Vector.zero);
|
|
17
|
+
this.offset = new actions_lib_1.Variable().set(helpers_lib_1.Vector.zero);
|
|
18
|
+
this.targetPosition = new actions_lib_1.Variable();
|
|
19
|
+
this.focusingNewTargetInfo = new actions_lib_1.Variable().set(undefined);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.CameraEntity = CameraEntity;
|
|
23
|
+
exports.CameraEntity = CameraEntity = __decorate([
|
|
24
|
+
(0, game_entities_1.EntityDecorator)({ global: true })
|
|
25
|
+
], CameraEntity);
|
|
26
|
+
//# sourceMappingURL=camera.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.entity.js","sourceRoot":"","sources":["../../../../../src/pixi/modules/CAMERA/🧊entities/camera.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6CAAuC;AACvC,6CAAqC;AAGrC,6DAA6E;AAUtE,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,+BAAe;IAA1C;;QACI,aAAQ,GAAG,IAAI,sBAAQ,EAAU,CAAC,GAAG,CAAC,oBAAM,CAAC,IAAI,CAAC,CAAC;QACnD,WAAM,GAAG,IAAI,sBAAQ,EAAU,CAAC,GAAG,CAAC,oBAAM,CAAC,IAAI,CAAC,CAAC;QAEjD,mBAAc,GAAG,IAAI,sBAAQ,EAAsB,CAAC;QAEpD,0BAAqB,GAAG,IAAI,sBAAQ,EAAqC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACpG,CAAC;CAAA,CAAA;AAPY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,+BAAe,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACrB,YAAY,CAOxB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CameraEntity } from '../🧊entities/camera.entity';
|
|
2
|
+
import { View } from '../../../../game-entities';
|
|
3
|
+
import { CameraLayer } from '../⚜️gateways';
|
|
4
|
+
export declare class CameraView extends View {
|
|
5
|
+
private entity;
|
|
6
|
+
private sceneContainer;
|
|
7
|
+
private uiLayer;
|
|
8
|
+
private cameraOffsetLayer;
|
|
9
|
+
private cameraLayer;
|
|
10
|
+
private foreground;
|
|
11
|
+
private mainLayer;
|
|
12
|
+
private backgroundLayer;
|
|
13
|
+
private animator;
|
|
14
|
+
constructor(entity: CameraEntity);
|
|
15
|
+
init(): Promise<void>;
|
|
16
|
+
protected afterDestroy(): void;
|
|
17
|
+
getLayerId(layer: CameraLayer): string;
|
|
18
|
+
appear(value: boolean): Promise<void>;
|
|
19
|
+
private convertToCameraPosition;
|
|
20
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CameraView = void 0;
|
|
13
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
14
|
+
const camera_entity_1 = require("../\uD83E\uDDCAentities/camera.entity");
|
|
15
|
+
const container_1 = require("../../../display-object/container");
|
|
16
|
+
const game_entities_1 = require("../../../../game-entities");
|
|
17
|
+
const utilities_1 = require("../../../../utilities");
|
|
18
|
+
const game_1 = require("../../../game");
|
|
19
|
+
const graphics_1 = require("../../../display-object/objects/graphics");
|
|
20
|
+
const __gateways_1 = require("../\u269C\uFE0Fgateways");
|
|
21
|
+
let CameraView = class CameraView extends game_entities_1.View {
|
|
22
|
+
constructor(entity) {
|
|
23
|
+
super();
|
|
24
|
+
this.entity = entity;
|
|
25
|
+
this.sceneContainer = new container_1.Container().setAlpha(0).setSortableChildren(true).displayParent(game_1.Game.instance.stage).attach(this);
|
|
26
|
+
this.uiLayer = new container_1.Container().setSortableChildren(true).setZIndex(2).displayParent(this.sceneContainer).attach(this);
|
|
27
|
+
this.cameraOffsetLayer = new container_1.Container().setZIndex(1).displayParent(this.sceneContainer).attach(this);
|
|
28
|
+
this.cameraLayer = new container_1.Container().setSortableChildren(true).displayParent(this.cameraOffsetLayer).attach(this);
|
|
29
|
+
this.foreground = new container_1.Container().setSortableChildren(true).setZIndex(20).displayParent(this.cameraLayer).attach(this);
|
|
30
|
+
this.mainLayer = new container_1.Container().setSortableChildren(true).setZIndex(10).displayParent(this.cameraLayer).attach(this);
|
|
31
|
+
this.backgroundLayer = new container_1.Container().setZIndex(0).displayParent(this.cameraLayer).attach(this);
|
|
32
|
+
}
|
|
33
|
+
async init() {
|
|
34
|
+
this.animator = new utilities_1.Animator(this.sceneContainer, 'alpha', {
|
|
35
|
+
duration: 500,
|
|
36
|
+
animation: new utilities_1.AnimationEaseInOutCubic(),
|
|
37
|
+
reAnimateHandling: utilities_1.ReAnimateHandlingType.completePrevious,
|
|
38
|
+
completeAnimationsHandling: utilities_1.CompleteAnimationsHandlingType.stayInCurrentState
|
|
39
|
+
}).attach(this);
|
|
40
|
+
let background = graphics_1.Graphics.createRectangle(new helpers_lib_1.Vector(1, 1), game_1.Game.instance.backgroundColor)
|
|
41
|
+
.toSprite()
|
|
42
|
+
.setAnchor(helpers_lib_1.Vector.zero)
|
|
43
|
+
.setZIndex(0)
|
|
44
|
+
.displayParent(this.sceneContainer)
|
|
45
|
+
.attach(this);
|
|
46
|
+
game_1.Game.instance.screenSize
|
|
47
|
+
.subscribe(value => {
|
|
48
|
+
background.aspectRatio = value.x / value.y;
|
|
49
|
+
background.scale = Math.max(value.x, value.y);
|
|
50
|
+
})
|
|
51
|
+
.attach(this);
|
|
52
|
+
game_1.Game.instance.setScreenPositionToStagePositionFunction(globalMousePosition => new helpers_lib_1.Vector(globalMousePosition.x - this.cameraLayer.position.x - this.cameraOffsetLayer.position.x, globalMousePosition.y - this.cameraLayer.position.y - this.cameraOffsetLayer.position.y));
|
|
53
|
+
this.entity.position
|
|
54
|
+
.subscribe(position => {
|
|
55
|
+
this.cameraLayer.position = this.convertToCameraPosition(position);
|
|
56
|
+
})
|
|
57
|
+
.attach(this);
|
|
58
|
+
this.entity.offset
|
|
59
|
+
.subscribe(offset => {
|
|
60
|
+
this.cameraOffsetLayer.position = offset;
|
|
61
|
+
})
|
|
62
|
+
.attach(this);
|
|
63
|
+
this.appear(true);
|
|
64
|
+
}
|
|
65
|
+
afterDestroy() {
|
|
66
|
+
game_1.Game.instance.resetScreenPositionToStagePositionFunction();
|
|
67
|
+
}
|
|
68
|
+
getLayerId(layer) {
|
|
69
|
+
switch (layer) {
|
|
70
|
+
case __gateways_1.CameraLayer.foreground:
|
|
71
|
+
return this.foreground.id;
|
|
72
|
+
case __gateways_1.CameraLayer.main:
|
|
73
|
+
return this.mainLayer.id;
|
|
74
|
+
case __gateways_1.CameraLayer.background:
|
|
75
|
+
return this.backgroundLayer.id;
|
|
76
|
+
case __gateways_1.CameraLayer.ui:
|
|
77
|
+
return this.uiLayer.id;
|
|
78
|
+
default:
|
|
79
|
+
throw new Error(`CameraView: getLayerId ${layer} is not supported`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async appear(value) {
|
|
83
|
+
return this.animator.animate({ alpha: value ? 1 : 0 });
|
|
84
|
+
}
|
|
85
|
+
convertToCameraPosition(positionInWorld) {
|
|
86
|
+
return helpers_lib_1.Vector.fromTo(positionInWorld, game_1.Game.instance.screenSizeCenter.value);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.CameraView = CameraView;
|
|
90
|
+
exports.CameraView = CameraView = __decorate([
|
|
91
|
+
(0, game_entities_1.ViewDecorator)({ entity: camera_entity_1.CameraEntity }),
|
|
92
|
+
__metadata("design:paramtypes", [camera_entity_1.CameraEntity])
|
|
93
|
+
], CameraView);
|
|
94
|
+
//# sourceMappingURL=camera.view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.view.js","sourceRoot":"","sources":["../../../../../src/pixi/modules/CAMERA/🧩views/camera.view.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAqC;AAErC,yEAA2D;AAC3D,iEAA8D;AAC9D,6DAAgE;AAChE,qDAAiI;AACjI,wCAAqC;AACrC,uEAAoE;AACpE,wDAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,oBAAI;IAYlC,YAAoB,MAAoB;QACtC,KAAK,EAAE,CAAC;QADU,WAAM,GAAN,MAAM,CAAc;QAXhC,mBAAc,GAAG,IAAI,qBAAS,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,WAAI,CAAC,QAAQ,CAAC,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Y,gCAAU;qBAAV,UAAU;IADtB,IAAA,6BAAa,EAAC,EAAE,MAAM,EAAE,4BAAY,EAAE,CAAC;qCAaV,4BAAY;GAZ7B,UAAU,CAuFtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bard-legends-framework",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.23",
|
|
4
4
|
"description": "Bard Legends Framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"eslint-config-prettier": "9.1.0",
|
|
51
51
|
"eslint-plugin-import": "2.29.1",
|
|
52
52
|
"eslint-plugin-no-null": "1.0.2",
|
|
53
|
-
"eslint-plugin-sort-class-members": "1.20.0",
|
|
54
53
|
"rollup-plugin-swc": "0.2.1",
|
|
55
54
|
"tslib": "2.6.2",
|
|
56
55
|
"typescript": "5.3.3",
|
package/package.json.bak
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bard-legends-framework",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.23",
|
|
4
4
|
"description": "Bard Legends Framework",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"eslint-config-prettier": "9.1.0",
|
|
51
51
|
"eslint-plugin-import": "2.29.1",
|
|
52
52
|
"eslint-plugin-no-null": "1.0.2",
|
|
53
|
-
"eslint-plugin-sort-class-members": "1.20.0",
|
|
54
53
|
"rollup-plugin-swc": "0.2.1",
|
|
55
54
|
"tslib": "2.6.2",
|
|
56
55
|
"typescript": "5.3.3",
|