@rpgjs/client 3.2.0 → 3.3.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.
Files changed (40) hide show
  1. package/lib/Components/AbstractComponent.d.ts +31 -0
  2. package/lib/Components/AbstractComponent.js +104 -0
  3. package/lib/Components/AbstractComponent.js.map +1 -0
  4. package/lib/Components/BarComponent.d.ts +20 -0
  5. package/lib/Components/BarComponent.js +168 -0
  6. package/lib/Components/BarComponent.js.map +1 -0
  7. package/lib/Components/ColorComponent.d.ts +8 -6
  8. package/lib/Components/ColorComponent.js +25 -11
  9. package/lib/Components/ColorComponent.js.map +1 -1
  10. package/lib/Components/Component.d.ts +24 -3
  11. package/lib/Components/Component.js +178 -28
  12. package/lib/Components/Component.js.map +1 -1
  13. package/lib/Components/DebugComponent.d.ts +10 -0
  14. package/lib/Components/DebugComponent.js +33 -0
  15. package/lib/Components/DebugComponent.js.map +1 -0
  16. package/lib/Components/IComponent.d.ts +0 -0
  17. package/lib/Components/IComponent.js +2 -0
  18. package/lib/Components/IComponent.js.map +1 -0
  19. package/lib/Components/ImageComponent.d.ts +8 -6
  20. package/lib/Components/ImageComponent.js +19 -5
  21. package/lib/Components/ImageComponent.js.map +1 -1
  22. package/lib/Components/ShapeComponent.d.ts +10 -0
  23. package/lib/Components/ShapeComponent.js +57 -0
  24. package/lib/Components/ShapeComponent.js.map +1 -0
  25. package/lib/Components/TextComponent.d.ts +8 -3
  26. package/lib/Components/TextComponent.js +26 -4
  27. package/lib/Components/TextComponent.js.map +1 -1
  28. package/lib/Components/TileComponent.d.ts +7 -6
  29. package/lib/Components/TileComponent.js +21 -9
  30. package/lib/Components/TileComponent.js.map +1 -1
  31. package/lib/Effects/Animation.d.ts +6 -0
  32. package/lib/Effects/Animation.js +25 -3
  33. package/lib/Effects/Animation.js.map +1 -1
  34. package/lib/GameEngine.d.ts +2 -0
  35. package/lib/GameEngine.js +30 -5
  36. package/lib/GameEngine.js.map +1 -1
  37. package/lib/Sprite/Character.d.ts +3 -0
  38. package/lib/Sprite/Character.js +9 -0
  39. package/lib/Sprite/Character.js.map +1 -1
  40. package/package.json +6 -5
@@ -3,13 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RpgComponent = void 0;
4
4
  const common_1 = require("@rpgjs/common");
5
5
  const types_1 = require("@rpgjs/types");
6
+ const rxjs_1 = require("rxjs");
6
7
  const operators_1 = require("rxjs/operators");
7
8
  const Logger_1 = require("../Logger");
8
9
  const Player_1 = require("../Sprite/Player");
9
- const ColorComponent_1 = require("./ColorComponent");
10
+ const BarComponent_1 = require("./BarComponent");
11
+ const ShapeComponent_1 = require("./ShapeComponent");
12
+ const DebugComponent_1 = require("./DebugComponent");
10
13
  const ImageComponent_1 = require("./ImageComponent");
11
14
  const TextComponent_1 = require("./TextComponent");
12
15
  const TileComponent_1 = require("./TileComponent");
16
+ const layoutObject = {
17
+ lines: []
18
+ };
19
+ const layoutTypes = ['top', 'bottom', 'left', 'right'];
13
20
  class RpgComponent extends PIXI.Container {
14
21
  constructor(data, scene) {
15
22
  super();
@@ -26,27 +33,48 @@ class RpgComponent extends PIXI.Container {
26
33
  this.map = '';
27
34
  this.z = 0;
28
35
  this.fixed = false;
29
- this.components = [];
36
+ this.components = {
37
+ top: layoutObject,
38
+ bottom: layoutObject,
39
+ left: layoutObject,
40
+ right: layoutObject,
41
+ center: layoutObject
42
+ };
30
43
  this.direction = 0;
31
44
  this.container = new PIXI.Container();
45
+ this.containersLayout = {};
46
+ this.layoutNotifierClear = {
47
+ top: new rxjs_1.Subject(),
48
+ bottom: new rxjs_1.Subject(),
49
+ left: new rxjs_1.Subject(),
50
+ right: new rxjs_1.Subject(),
51
+ center: new rxjs_1.Subject()
52
+ };
32
53
  this.registerComponents = new Map();
54
+ this.game = this.scene.game;
55
+ this.id = this.data.id;
33
56
  this.setPosition(false);
34
57
  this.registerComponents.set(Player_1.RpgSprite.id, Player_1.RpgSprite);
35
58
  this.registerComponents.set(TextComponent_1.TextComponent.id, TextComponent_1.TextComponent);
36
- this.registerComponents.set(ColorComponent_1.ColorComponent.id, ColorComponent_1.ColorComponent);
59
+ this.registerComponents.set(ShapeComponent_1.ShapeComponent.id, ShapeComponent_1.ShapeComponent);
37
60
  this.registerComponents.set(TileComponent_1.TileComponent.id, TileComponent_1.TileComponent);
38
61
  this.registerComponents.set(ImageComponent_1.ImageComponent.id, ImageComponent_1.ImageComponent);
62
+ this.registerComponents.set(BarComponent_1.BarComponent.id, BarComponent_1.BarComponent);
63
+ this.registerComponents.set(DebugComponent_1.DebugComponent.id, DebugComponent_1.DebugComponent);
39
64
  this.addChild(this.container);
65
+ for (let layout of [...layoutTypes, 'center']) {
66
+ this.containersLayout[layout] = new PIXI.Container();
67
+ this.container.addChild(this.containersLayout[layout]);
68
+ }
40
69
  common_1.RpgPlugin.emit(common_1.HookClient.AddSprite, this);
41
70
  common_1.RpgPlugin.emit(common_1.HookClient.SceneAddSprite, [this.scene, this], true);
42
- this.scene.game.listenObject(data.id)
43
- .pipe((0, operators_1.map)(object => object === null || object === void 0 ? void 0 : object.paramsChanged), (0, operators_1.tap)(() => {
71
+ this.game.listenObject(data.id)
72
+ .pipe((0, operators_1.takeUntil)(this.game.getDeleteNotifier(data.id)), (0, operators_1.map)(object => object === null || object === void 0 ? void 0 : object.paramsChanged), (0, operators_1.tap)(() => {
44
73
  var _a, _b;
45
74
  common_1.RpgPlugin.emit(common_1.HookClient.ChangesSprite, [this, (_a = this.logic) === null || _a === void 0 ? void 0 : _a['paramsChanged'], (_b = this.logic) === null || _b === void 0 ? void 0 : _b['prevParamsChanged']], true);
46
75
  }), (0, operators_1.filter)(object => {
47
76
  var _a;
48
- const componentChanged = (_a = this.logic) === null || _a === void 0 ? void 0 : _a['componentChanged'];
49
- return componentChanged && componentChanged.length;
77
+ return (_a = this.logic) === null || _a === void 0 ? void 0 : _a['componentChanged'];
50
78
  }))
51
79
  .subscribe((val) => {
52
80
  var _a;
@@ -237,44 +265,166 @@ class RpgComponent extends PIXI.Container {
237
265
  * @memberof RpgSprite
238
266
  */
239
267
  getPositionsOfGraphic(align) {
240
- var _a, _b;
268
+ var _a, _b, _c;
241
269
  let sprite;
242
270
  // if no component (no graphic for example)
243
- if (this.components.length !== 0) {
244
- sprite = this.container.getChildAt(0);
271
+ if (((_a = this.components.center) === null || _a === void 0 ? void 0 : _a.lines.length) !== 0) {
272
+ sprite = this.containersLayout.center.getChildAt(0);
245
273
  }
246
274
  const isMiddle = align == 'middle';
247
275
  return {
248
- x: this.x - this.w * ((_a = sprite === null || sprite === void 0 ? void 0 : sprite.anchor.x) !== null && _a !== void 0 ? _a : 1) + (isMiddle ? this.w / 2 : 0),
249
- y: this.y - this.h * ((_b = sprite === null || sprite === void 0 ? void 0 : sprite.anchor.y) !== null && _b !== void 0 ? _b : 1) + (isMiddle ? this.h / 2 : 0)
276
+ x: this.x - this.w * ((_b = sprite === null || sprite === void 0 ? void 0 : sprite.anchor.x) !== null && _b !== void 0 ? _b : 1) + (isMiddle ? this.w / 2 : 0),
277
+ y: this.y - this.h * ((_c = sprite === null || sprite === void 0 ? void 0 : sprite.anchor.y) !== null && _c !== void 0 ? _c : 1) + (isMiddle ? this.h / 2 : 0)
250
278
  };
251
279
  }
280
+ /**
281
+ * Get the container by position (center, left, right, top, bottom)
282
+ *
283
+ * @param {LayoutPositionEnum} [position=center]
284
+ * @returns {PIXI.Container}
285
+ *
286
+ * */
287
+ getLayoutContainer(position = 'center') {
288
+ return this.containersLayout[position];
289
+ }
290
+ /**
291
+ * Get Current Scene. Scene is a map, battle, menu, etc.
292
+ * @returns {T}
293
+ */
294
+ getScene() {
295
+ return this.scene;
296
+ }
297
+ // Hooks
298
+ onInit() { }
299
+ onUpdate(obj) { }
300
+ onMove() { }
301
+ onChanges(data, old) { }
252
302
  callMethodInComponents(name, params) {
253
- for (let component of this.container.children) {
303
+ for (let component of this.getLayoutContainer().children) {
254
304
  if (component[name])
255
305
  component[name](...params);
256
306
  }
257
307
  }
258
- updateComponents(components) {
259
- this.container.removeChildren();
260
- for (let component of components) {
261
- const compClass = this.registerComponents.get(component.id);
262
- if (!compClass) {
263
- throw (0, Logger_1.log)(`Impossible to find ${component.id} component`);
308
+ createGrid(position, gridArray, options, sprite) {
309
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
310
+ const gridContainer = new PIXI.Sprite();
311
+ const { height, spriteWidth, spriteHeight } = sprite;
312
+ const width = (_b = (_a = options.width) !== null && _a !== void 0 ? _a : spriteWidth) !== null && _b !== void 0 ? _b : sprite.width;
313
+ const gridHeight = (_c = options.height) !== null && _c !== void 0 ? _c : 20;
314
+ const hitBoxWidth = (_e = (_d = this.logic) === null || _d === void 0 ? void 0 : _d.hitbox.w) !== null && _e !== void 0 ? _e : 0;
315
+ const middleWidth = hitBoxWidth / 2 - width / 2;
316
+ const posX = gridContainer.x + ((_f = options.marginLeft) !== null && _f !== void 0 ? _f : 0) - ((_g = options.marginRight) !== null && _g !== void 0 ? _g : 0);
317
+ const posY = gridContainer.y + ((_j = (_h = this.logic) === null || _h === void 0 ? void 0 : _h.hitbox.h) !== null && _j !== void 0 ? _j : 0) + ((_k = options.marginTop) !== null && _k !== void 0 ? _k : 0) - ((_l = options.marginBottom) !== null && _l !== void 0 ? _l : 0);
318
+ switch (position) {
319
+ case 'top':
320
+ gridContainer.x = posX + middleWidth;
321
+ gridContainer.y = posY - spriteHeight;
322
+ gridContainer.y -= (gridArray.length * gridHeight);
323
+ break;
324
+ case 'bottom':
325
+ gridContainer.x = posX + middleWidth;
326
+ gridContainer.y = posY;
327
+ break;
328
+ case 'left':
329
+ gridContainer.x = posX - width - (hitBoxWidth < spriteWidth ? hitBoxWidth / 2 : 0);
330
+ gridContainer.y = posY - spriteHeight;
331
+ break;
332
+ case 'right':
333
+ gridContainer.x = posX + width + (hitBoxWidth > spriteWidth ? hitBoxWidth / 2 : 0);
334
+ gridContainer.y = posY - spriteHeight;
335
+ }
336
+ for (let y = 0; y < gridArray.length; y++) {
337
+ const columns = gridArray[y].col.length;
338
+ const cellWidth = (width / columns);
339
+ for (let x = 0; x < columns; x++) {
340
+ const params = gridArray[y].col[x];
341
+ const component = this.applyComponent(params);
342
+ component.onRender$
343
+ .pipe((0, operators_1.takeUntil)(this.layoutNotifierClear[position]), (0, operators_1.finalize)(() => {
344
+ component.onRemove();
345
+ }))
346
+ .subscribe(() => {
347
+ component.x = Math.round((x * cellWidth) + (cellWidth / 2) - (component.width / 2));
348
+ component.y = Math.round((y * gridHeight) + (gridHeight / 2) - (component.height / 2));
349
+ });
350
+ component.onInit({
351
+ width: cellWidth,
352
+ height: gridHeight
353
+ });
354
+ gridContainer.addChild(component);
355
+ }
356
+ }
357
+ return gridContainer;
358
+ }
359
+ applyComponent(component) {
360
+ const compClass = this.registerComponents.get(component.id);
361
+ if (!compClass) {
362
+ throw (0, Logger_1.log)(`Impossible to find ${component.id} component`);
363
+ }
364
+ return new compClass(this, component.value);
365
+ }
366
+ createComponentCenter(components) {
367
+ var _a;
368
+ const lines = ((_a = components.center) === null || _a === void 0 ? void 0 : _a.lines) || [];
369
+ this.getLayoutContainer().removeChildren();
370
+ for (let { col } of lines) {
371
+ for (let component of col) {
372
+ const instance = this.applyComponent(component);
373
+ if (instance.onInit)
374
+ instance.onInit({
375
+ width: this.width,
376
+ height: this.height
377
+ });
378
+ this.getLayoutContainer().addChild(instance);
264
379
  }
265
- const instance = new compClass(this, component.value);
266
- this.container.addChild(instance);
267
380
  }
268
381
  this.components = components;
269
382
  }
270
- getScene() {
271
- return this.scene;
383
+ refreshComponents(components, sprite) {
384
+ for (let type of layoutTypes) {
385
+ const layout = components[type];
386
+ if (layout === null || layout === void 0 ? void 0 : layout.lines) {
387
+ const layoutContainer = this.getLayoutContainer(type);
388
+ layoutContainer.removeChildren();
389
+ this.layoutNotifierClear[type].next();
390
+ layoutContainer.addChild(this.createGrid(type, layout.lines, layout, sprite));
391
+ }
392
+ }
393
+ }
394
+ updateComponents(components) {
395
+ var _a;
396
+ const graphicChanged = !!((_a = components.center) === null || _a === void 0 ? void 0 : _a.lines);
397
+ if (graphicChanged) {
398
+ this.createComponentCenter(components);
399
+ }
400
+ if (this.subscriptionGraphic)
401
+ this.subscriptionGraphic.unsubscribe();
402
+ const child = this.getLayoutContainer().children[0];
403
+ if (child instanceof Player_1.RpgSprite) {
404
+ this.subscriptionGraphic = child.animationSprite()
405
+ .pipe((0, operators_1.takeUntil)(this.game.getDeleteNotifier(this.id)), (0, operators_1.filter)((sprite) => sprite), (0, operators_1.distinctUntilChanged)((p, q) => p.width === q.width &&
406
+ p.height === q.height &&
407
+ p.anchor.x === q.anchor.x &&
408
+ p.anchor.y === q.anchor.y))
409
+ .subscribe((sprite) => {
410
+ this.refreshComponents(components, sprite);
411
+ });
412
+ }
413
+ else {
414
+ this.refreshComponents(components, {
415
+ width: this.data.width,
416
+ height: this.data.height,
417
+ anchor: {
418
+ x: 0,
419
+ y: 0
420
+ },
421
+ x: 0,
422
+ y: 0,
423
+ spriteHeight: this.data.height,
424
+ spriteWidth: this.data.width
425
+ });
426
+ }
272
427
  }
273
- // Hooks
274
- onInit() { }
275
- onUpdate(obj) { }
276
- onMove() { }
277
- onChanges(data, old) { }
278
428
  }
279
429
  exports.RpgComponent = RpgComponent;
280
430
  //# sourceMappingURL=Component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Component.js","sourceRoot":"","sources":["../../src/Components/Component.ts"],"names":[],"mappings":";;;AAAA,0CAAkG;AAClG,wCAAqD;AACrD,8CAAiD;AACjD,sCAA+B;AAE/B,6CAA4C;AAC5C,qDAAiD;AACjD,qDAAiD;AACjD,mDAA+C;AAC/C,mDAA+C;AAS/C,MAAa,YAAsB,SAAQ,IAAI,CAAC,SAAS;IAuBrD,YAAoB,IAAgC,EAAU,KAAY;QACtE,KAAK,EAAE,CAAA;QADS,SAAI,GAAJ,IAAI,CAA4B;QAAU,UAAK,GAAL,KAAK,CAAO;QApB1E,gBAAgB;QAChB,MAAC,G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B,MAAM,EAAE;oBACJ,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,CAAC;iBACP;gBACD,CAAC,EAAE,CAAC;gBACJ,CAAC,EAAE,CAAC;gBACJ,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM;gBAC9B,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;aAC/B,CAAC,CAAA;SACL;IAEL,CAAC;CACJ;AApdD,oCAodC"}
@@ -0,0 +1,10 @@
1
+ import { AbstractComponent, CellInfo } from "./AbstractComponent";
2
+ import { DebugComponentObject } from "@rpgjs/types";
3
+ export declare class DebugComponent extends AbstractComponent<DebugComponentObject, PIXI.Graphics> {
4
+ static readonly id: string;
5
+ color: string;
6
+ cacheParams: string[];
7
+ private container;
8
+ onInit(cell: CellInfo): void;
9
+ updateRender(object: any): void;
10
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DebugComponent = void 0;
4
+ const common_1 = require("@rpgjs/common");
5
+ const AbstractComponent_1 = require("./AbstractComponent");
6
+ class DebugComponent extends AbstractComponent_1.AbstractComponent {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.color = '#ff0000';
10
+ this.cacheParams = ['map', 'position.x', 'position.y'];
11
+ this.container = new PIXI.Graphics();
12
+ }
13
+ onInit(cell) {
14
+ this.addChild(this.container);
15
+ this.updateRender(this.component.logic);
16
+ this.interactive = true;
17
+ this.on('pointerdown', () => {
18
+ console.log(this.component.logic);
19
+ });
20
+ super.onInit(cell);
21
+ }
22
+ updateRender(object) {
23
+ const hitbox = object.hitbox;
24
+ const { pos, w, h } = hitbox;
25
+ this.container.clear();
26
+ this.container.beginFill(common_1.Utils.hexaToNumber(this.color));
27
+ this.container.drawRect(0, 0, w, h);
28
+ this.container.endFill();
29
+ }
30
+ }
31
+ exports.DebugComponent = DebugComponent;
32
+ DebugComponent.id = 'debug';
33
+ //# sourceMappingURL=DebugComponent.js.map
@@ -0,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AAO,CAAA"}
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=IComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IComponent.js","sourceRoot":"","sources":["../../src/Components/IComponent.ts"],"names":[],"mappings":""}
@@ -1,8 +1,10 @@
1
- import { RpgComponent } from "./Component";
2
- export declare class ImageComponent extends PIXI.Container {
3
- private component;
4
- private source;
1
+ import { ImageComponentObject } from "@rpgjs/types";
2
+ import { AbstractComponent, CellInfo } from "./AbstractComponent";
3
+ export declare class ImageComponent extends AbstractComponent<ImageComponentObject, PIXI.Container> {
5
4
  static readonly id: string;
6
- constructor(component: RpgComponent, source: string);
7
- setImage(): void;
5
+ cacheParams: string[];
6
+ source: string;
7
+ onInit(cell: CellInfo): void;
8
+ private setImage;
9
+ updateRender(object: any): void;
8
10
  }
@@ -1,14 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ImageComponent = void 0;
4
- class ImageComponent extends PIXI.Container {
5
- constructor(component, source) {
6
- super();
7
- this.component = component;
8
- this.source = source;
4
+ const AbstractComponent_1 = require("./AbstractComponent");
5
+ class ImageComponent extends AbstractComponent_1.AbstractComponent {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.cacheParams = [];
9
+ this.source = '';
10
+ }
11
+ onInit(cell) {
12
+ super.onInit(cell);
9
13
  this.setImage();
10
14
  }
11
15
  setImage() {
16
+ if (typeof this.value == 'string') {
17
+ this.source = this.value;
18
+ }
19
+ else {
20
+ this.source = this.value.source;
21
+ }
22
+ this.updateRender({});
23
+ }
24
+ updateRender(object) {
25
+ this.removeChildren();
12
26
  const engine = this.component.getScene().game.clientEngine;
13
27
  this.addChild(PIXI.Sprite.from(engine.getResourceUrl(this.source)));
14
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ImageComponent.js","sourceRoot":"","sources":["../../src/Components/ImageComponent.ts"],"names":[],"mappings":";;;AAGA,MAAa,cAAe,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CAAC,YAAY,CAAA;QACpE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC;;AAvBL,wCAwBC;AAvBmB,iBAAE,GAAW,OAAO,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { AbstractComponent, CellInfo } from "./AbstractComponent";
2
+ import { ShapeComponentObject } from "@rpgjs/types";
3
+ export declare class ShapeComponent extends AbstractComponent<ShapeComponentObject, PIXI.Graphics> {
4
+ static readonly id: string;
5
+ private type;
6
+ private container;
7
+ cacheParams: string[];
8
+ onInit(cell: CellInfo): void;
9
+ updateRender(object: any): void;
10
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShapeComponent = void 0;
4
+ const common_1 = require("@rpgjs/common");
5
+ const AbstractComponent_1 = require("./AbstractComponent");
6
+ class ShapeComponent extends AbstractComponent_1.AbstractComponent {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.type = this.value.type;
10
+ this.container = new PIXI.Graphics();
11
+ this.cacheParams = [];
12
+ }
13
+ onInit(cell) {
14
+ this.updateRender(this.component.logic);
15
+ this.addChild(this.container);
16
+ super.onInit(cell);
17
+ }
18
+ updateRender(object) {
19
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
20
+ const value = this.value;
21
+ const height = (_c = (_a = this.getValue(object, value.height)) !== null && _a !== void 0 ? _a : (_b = this.cell) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 0;
22
+ const width = (_f = (_d = this.getValue(object, value.width)) !== null && _d !== void 0 ? _d : (_e = this.cell) === null || _e === void 0 ? void 0 : _e.width) !== null && _f !== void 0 ? _f : 0;
23
+ this.container.clear();
24
+ this.container.beginFill(common_1.Utils.hexaToNumber(this.value.fill));
25
+ if (value.line) {
26
+ this.container.lineStyle((_g = this.getValue(object, value.line.width)) !== null && _g !== void 0 ? _g : 1, common_1.Utils.hexaToNumber((_h = value.line.color) !== null && _h !== void 0 ? _h : this.value.fill), (_j = this.getValue(object, value.line.alpha)) !== null && _j !== void 0 ? _j : 1);
27
+ }
28
+ switch (this.type) {
29
+ case 'circle':
30
+ this.container.drawCircle(0, 0, this.getValue(object, value.radius));
31
+ break;
32
+ case 'ellipse':
33
+ this.container.drawEllipse(0, 0, width, height);
34
+ break;
35
+ case 'line':
36
+ if (!value.line) {
37
+ this.container.lineStyle(1, common_1.Utils.hexaToNumber(this.value.fill));
38
+ }
39
+ this.container.moveTo(this.getValue(object, value.x1), this.getValue(object, value.y1));
40
+ this.container.lineTo(this.getValue(object, value.x2), this.getValue(object, value.y2));
41
+ break;
42
+ case 'polygon':
43
+ this.container.drawPolygon(value.points);
44
+ break;
45
+ case 'rounded-rect':
46
+ this.container.drawRoundedRect(0, 0, width, height, value.radius);
47
+ break;
48
+ default:
49
+ this.container.drawRect(0, 0, width, height);
50
+ break;
51
+ }
52
+ this.container.endFill();
53
+ }
54
+ }
55
+ exports.ShapeComponent = ShapeComponent;
56
+ ShapeComponent.id = 'shape';
57
+ //# sourceMappingURL=ShapeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShapeComponent.js","sourceRoot":"","sources":["../../src/Components/ShapeComponent.ts"],"names":[],"mappings":";;;AAAA,0CAAqC;AACrC,2DAAiE;AAGjE,MAAa,cAAe,SAAQ,qCAAsD;IAA1F;;QAEY,SAAI,GAA0C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAA;QAC7D,cAAS,GAAkB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAA;QACtD,gBAAW,GAAa,EAAE,CAAA;IAmD9B,CAAC;IAjDG,MAAM,CAAC,IAAc;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QACvC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CA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IXI.Text {
2
- private data;
1
+ import { TextComponentObject } from "@rpgjs/types";
2
+ import { AbstractComponent } from "./AbstractComponent";
3
+ export declare class TextComponent extends AbstractComponent<TextComponentObject, PIXI.Text> {
3
4
  static readonly id: string;
4
- constructor(data: any, _text: string);
5
+ cacheParams: string[];
6
+ private container;
7
+ private originValue;
8
+ onInit(cell: PIXI.Graphics): void;
9
+ updateRender(object: any): void;
5
10
  }
@@ -1,10 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TextComponent = void 0;
4
- class TextComponent extends PIXI.Text {
5
- constructor(data, _text) {
6
- super(_text);
7
- this.data = data;
4
+ const AbstractComponent_1 = require("./AbstractComponent");
5
+ class TextComponent extends AbstractComponent_1.AbstractComponent {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.cacheParams = [];
9
+ this.container = new PIXI.Text('');
10
+ this.originValue = '';
11
+ }
12
+ onInit(cell) {
13
+ if (typeof this.value == 'string') {
14
+ this.container.text = this.value;
15
+ }
16
+ else {
17
+ this.container.style = this.value.style;
18
+ this.container.text = this.value.text;
19
+ }
20
+ this.container.style = Object.assign(Object.assign({}, this.container.style), { wordWrapWidth: cell.width });
21
+ this.parseTextAndCache(this.container.text);
22
+ this.originValue = this.container.text;
23
+ // first render for replace variable and remove {}
24
+ this.updateRender(this.component.logic);
25
+ this.addChild(this.container);
26
+ super.onInit(cell);
27
+ }
28
+ updateRender(object) {
29
+ this.container.text = this.replaceText(object, this.originValue);
8
30
  }
9
31
  }
10
32
  exports.TextComponent = TextComponent;
@@ -1 +1 @@
1
- {"version":3,"file":"TextComponent.js","sourceRoot":"","sources":["../../src/Components/TextComponent.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAc,SAAQ,IAAI,CAAC,IAAI;IAGxC,YAAoB,IAAI,EAAE,KAAa;QACnC,KAAK,CAAC,KAAK,CAAC,CAAA;QADI,SAAI,GAAJ,IAAI,CAAA;IAExB,CAAC;;AALL,sCAM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CAAA;IACpE,CAAC;;AA3BL,sCA4BC;AA3BmB,gBAAE,GAAW,MAAM,CAAA"}
@@ -1,8 +1,9 @@
1
- import { RpgComponent } from "./Component";
2
- export declare class TileComponent extends PIXI.Container {
3
- private component;
4
- private gid;
1
+ import { TileComponentObject } from "@rpgjs/types";
2
+ import { AbstractComponent, CellInfo } from "./AbstractComponent";
3
+ export declare class TileComponent extends AbstractComponent<TileComponentObject, PIXI.Container> {
5
4
  static readonly id: string;
6
- constructor(component: RpgComponent, gid: number);
7
- setTile(): void;
5
+ cacheParams: string[];
6
+ gid: number;
7
+ onInit(cell: CellInfo): void;
8
+ updateRender(object: any): void;
8
9
  }
@@ -6,14 +6,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TileComponent = void 0;
7
7
  const Tile_1 = __importDefault(require("../Tilemap/Tile"));
8
8
  const TileLayer_1 = __importDefault(require("../Tilemap/TileLayer"));
9
- class TileComponent extends PIXI.Container {
10
- constructor(component, gid) {
11
- super();
12
- this.component = component;
13
- this.gid = gid;
14
- this.setTile();
9
+ const AbstractComponent_1 = require("./AbstractComponent");
10
+ class TileComponent extends AbstractComponent_1.AbstractComponent {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.cacheParams = [];
14
+ this.gid = 0;
15
15
  }
16
- setTile() {
16
+ onInit(cell) {
17
+ if (typeof this.value == 'number') {
18
+ this.gid = this.value;
19
+ }
20
+ else {
21
+ this.gid = this.value.gid;
22
+ }
23
+ this.updateRender({});
24
+ super.onInit(cell);
25
+ }
26
+ updateRender(object) {
27
+ var _a, _b, _c, _d;
28
+ this.removeChildren();
17
29
  const scene = this.component.getScene();
18
30
  const tilemap = scene.tilemap;
19
31
  const tileset = TileLayer_1.default.findTileSet(this.gid, tilemap.tilesets);
@@ -21,8 +33,8 @@ class TileComponent extends PIXI.Container {
21
33
  const tile = new Tile_1.default({
22
34
  gid: this.gid
23
35
  }, tileset);
24
- tile.width = this.component.w;
25
- tile.height = this.component.h;
36
+ tile.width = (_b = (_a = this.cell) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0;
37
+ tile.height = (_d = (_c = this.cell) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0;
26
38
  this.addChild(tile);
27
39
  }
28
40
  }