@safe-engine/pixi 8.0.5 → 8.1.2

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/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAKrC,eAAO,MAAM,GAAG,yCAAoB,CAAA;AAEpC,wBAAsB,eAAe,CAAC,EAAE,SAAS,iBAehD;AAED,wBAAgB,eAAe,CAAC,kBAAkB;;;CAA+B,QAKhF;AAYD,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,QAWtE"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAGrC,eAAO,MAAM,GAAG,yCAAoB,CAAA;AAEpC,wBAAsB,eAAe,CAAC,EAAE,SAAS,iBAehD;AAED,wBAAgB,eAAe,CAAC,kBAAkB;;;CAA+B,QAKhF;AAYD,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,QAWtE"}
package/dist/app.js CHANGED
@@ -16,7 +16,6 @@ exports.startGameWithSystems = startGameWithSystems;
16
16
  const core_1 = require("@safe-engine/core");
17
17
  const pixi_js_1 = require("pixi.js");
18
18
  const pixi_action_ease_1 = require("pixi-action-ease");
19
- const NodeComp_1 = require("./components/NodeComp");
20
19
  exports.app = new pixi_js_1.Application();
21
20
  function addGameCanvasTo() {
22
21
  return __awaiter(this, arguments, void 0, function* (id = 'game') {
@@ -33,7 +32,7 @@ function addGameCanvasTo() {
33
32
  },
34
33
  canvas: document.getElementById(id)
35
34
  });
36
- core_1.GameWorld.Instance.setup(NodeComp_1.NodeComp, exports.app.stage);
35
+ // GameWorld.Instance.setup(NodeComp, app.stage)
37
36
  });
38
37
  }
39
38
  function setupResolution(designedResolution = { width: 720, height: 1280 }) {
@@ -0,0 +1,11 @@
1
+ import { EnhancedComponent } from '@safe-engine/core';
2
+ import { Container } from 'pixi.js';
3
+ import { NodeComp } from './NodeComp';
4
+ export declare class NoRenderComponentX<C extends Container = Container> extends EnhancedComponent<NodeComp<C>> {
5
+ static create(data?: any): NoRenderComponentX<Container<import("pixi.js").ContainerChild>>;
6
+ }
7
+ export declare class ComponentX<C extends Container = Container> extends EnhancedComponent<NodeComp<C>> {
8
+ static hasRender: boolean;
9
+ static create(data?: any): ComponentX<Container<import("pixi.js").ContainerChild>>;
10
+ }
11
+ //# sourceMappingURL=BaseComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseComponent.d.ts","sourceRoot":"","sources":["../../src/components/BaseComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,qBAAa,kBAAkB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG;CAGzB;AAED,qBAAa,UAAU,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7F,MAAM,CAAC,SAAS,UAAO;IACvB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG;CAMzB"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComponentX = exports.NoRenderComponentX = void 0;
4
+ const core_1 = require("@safe-engine/core");
5
+ class NoRenderComponentX extends core_1.EnhancedComponent {
6
+ static create(data) {
7
+ return new this(data);
8
+ }
9
+ }
10
+ exports.NoRenderComponentX = NoRenderComponentX;
11
+ class ComponentX extends core_1.EnhancedComponent {
12
+ static create(data) {
13
+ const world = core_1.GameWorld.Instance;
14
+ const root = world.entities.create();
15
+ const comp = root.assign(new this(data));
16
+ return comp;
17
+ }
18
+ }
19
+ exports.ComponentX = ComponentX;
20
+ ComponentX.hasRender = true;
@@ -1,9 +1,8 @@
1
- import { Input, ProgressBar } from '@pixi/ui';
2
- import { ComponentX, NoRenderComponentX } from '@safe-engine/core';
1
+ import { CheckBox, CheckBoxOptions, Input, List, ProgressBar, RadioGroup, Slider, SliderOptions } from '@pixi/ui';
3
2
  import { Container, FillInput, Point, Text } from 'pixi.js';
4
3
  import { Color4B } from '../core/Color';
5
4
  import { LoadingBarMode, ProgressTimer } from '../core/LoadingBar';
6
- import { NodeComp } from './NodeComp';
5
+ import { ComponentX, NoRenderComponentX } from './BaseComponent';
7
6
  export declare const FillType: {
8
7
  HORIZONTAL: number;
9
8
  VERTICAL: number;
@@ -11,7 +10,7 @@ export declare const FillType: {
11
10
  };
12
11
  type Keys = keyof typeof FillType;
13
12
  type Values = (typeof FillType)[Keys];
14
- export declare class ButtonComp extends NoRenderComponentX<NodeComp> {
13
+ export declare class ButtonComp extends NoRenderComponentX {
15
14
  normalImage: string;
16
15
  selectedImage: string;
17
16
  disableImage: string;
@@ -20,7 +19,7 @@ export declare class ButtonComp extends NoRenderComponentX<NodeComp> {
20
19
  setOnPress(cb: (target: ButtonComp) => void): void;
21
20
  set enabled(val: any);
22
21
  }
23
- export declare class ProgressBarComp extends NoRenderComponentX<NodeComp<ProgressBar>> {
22
+ export declare class ProgressBarComp extends ComponentX<ProgressBar> {
24
23
  mode: LoadingBarMode;
25
24
  isReverse: boolean;
26
25
  bg: string;
@@ -28,7 +27,7 @@ export declare class ProgressBarComp extends NoRenderComponentX<NodeComp<Progres
28
27
  get progress(): number;
29
28
  set progress(val: number);
30
29
  }
31
- export declare class LabelComp extends ComponentX<NodeComp<Text>> {
30
+ export declare class LabelComp extends ComponentX<Text> {
32
31
  font: string;
33
32
  string: string;
34
33
  size: number;
@@ -39,13 +38,13 @@ export declare class LabelComp extends ComponentX<NodeComp<Text>> {
39
38
  getFont(): string;
40
39
  setFont(val: string): void;
41
40
  }
42
- export declare class ScrollView extends ComponentX<NodeComp<Container>> {
41
+ export declare class ScrollView extends NoRenderComponentX {
43
42
  width: number;
44
43
  height: number;
45
44
  }
46
- export declare class BlockInputEventsComp extends NoRenderComponentX<NodeComp<Container>> {
45
+ export declare class BlockInputEventsComp extends NoRenderComponentX {
47
46
  }
48
- export declare class ProgressTimerComp extends ComponentX<NodeComp<ProgressTimer>> {
47
+ export declare class ProgressTimerComp extends ComponentX<ProgressTimer> {
49
48
  spriteFrame: string;
50
49
  fillType: Values;
51
50
  fillRange: number;
@@ -55,28 +54,40 @@ export declare class ProgressTimerComp extends ComponentX<NodeComp<ProgressTimer
55
54
  setFillStart(val: number): void;
56
55
  setFillRange(val: number): void;
57
56
  }
58
- export declare class RichTextComp extends ComponentX<NodeComp<Text>> {
57
+ export declare class RichTextComp extends ComponentX<Text> {
59
58
  protected font: string;
60
59
  protected string: string;
61
60
  protected size: number;
62
61
  getString(): string;
63
62
  setString(val: string): void;
64
63
  }
65
- export declare class LabelOutlineComp extends NoRenderComponentX<NodeComp> {
64
+ export declare class LabelOutlineComp extends NoRenderComponentX {
66
65
  color: typeof Color4B;
67
66
  width: number;
68
67
  }
69
- export declare class LabelShadowComp extends NoRenderComponentX<NodeComp> {
68
+ export declare class LabelShadowComp extends NoRenderComponentX {
70
69
  color: typeof Color4B;
71
70
  blur: number;
72
71
  offset: Point;
73
72
  }
74
- export declare class InputComp extends ComponentX<NodeComp<Input>> {
73
+ export declare class InputComp extends ComponentX<Input> {
75
74
  bg: string;
76
75
  fill: FillInput;
77
76
  font: string;
78
77
  string: string;
79
78
  size: number;
80
79
  }
80
+ export declare class ListComp extends ComponentX<List> {
81
+ }
82
+ export declare class SliderComp extends ComponentX<Slider> {
83
+ bg: string;
84
+ fill: SliderOptions['fill'];
85
+ slider: Container;
86
+ }
87
+ export declare class RadioGroupComp extends ComponentX<RadioGroup> {
88
+ }
89
+ export declare class CheckBoxComp extends ComponentX<CheckBox> {
90
+ style: CheckBoxOptions['style'];
91
+ }
81
92
  export {};
82
93
  //# sourceMappingURL=GUIComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GUIComponent.d.ts","sourceRoot":"","sources":["../../src/components/GUIComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAU,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,eAAO,MAAM,QAAQ;;;;CAIpB,CAAA;AACD,KAAK,IAAI,GAAG,MAAM,OAAO,QAAQ,CAAA;AACjC,KAAK,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA;AAErC,qBAAa,UAAW,SAAQ,kBAAkB,CAAC,QAAQ,CAAC;IAC1D,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,CAAC,MAAM,EAA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C,QAAQ,CAAC;IACpD,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;CACjC"}
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InputComp = exports.LabelShadowComp = exports.LabelOutlineComp = exports.RichTextComp = exports.ProgressTimerComp = exports.BlockInputEventsComp = exports.ScrollView = exports.LabelComp = exports.ProgressBarComp = exports.ButtonComp = exports.FillType = void 0;
4
- const core_1 = require("@safe-engine/core");
3
+ exports.CheckBoxComp = exports.RadioGroupComp = exports.SliderComp = exports.ListComp = exports.InputComp = exports.LabelShadowComp = exports.LabelOutlineComp = exports.RichTextComp = exports.ProgressTimerComp = exports.BlockInputEventsComp = exports.ScrollView = exports.LabelComp = exports.ProgressBarComp = exports.ButtonComp = exports.FillType = void 0;
5
4
  const pixi_js_1 = require("pixi.js");
6
5
  const LoadingBar_1 = require("../core/LoadingBar");
6
+ const BaseComponent_1 = require("./BaseComponent");
7
7
  // const _htmlTextParser = new HtmlTextParser()
8
8
  exports.FillType = {
9
9
  HORIZONTAL: 0,
10
10
  VERTICAL: 1,
11
11
  RADIAL: 2,
12
12
  };
13
- class ButtonComp extends core_1.NoRenderComponentX {
13
+ class ButtonComp extends BaseComponent_1.NoRenderComponentX {
14
14
  setOnPress(cb) {
15
15
  this.onPress = cb;
16
16
  }
@@ -19,7 +19,7 @@ class ButtonComp extends core_1.NoRenderComponentX {
19
19
  }
20
20
  }
21
21
  exports.ButtonComp = ButtonComp;
22
- class ProgressBarComp extends core_1.NoRenderComponentX {
22
+ class ProgressBarComp extends BaseComponent_1.ComponentX {
23
23
  constructor() {
24
24
  super(...arguments);
25
25
  this.mode = LoadingBar_1.LoadingBarMode.BAR;
@@ -32,7 +32,7 @@ class ProgressBarComp extends core_1.NoRenderComponentX {
32
32
  }
33
33
  }
34
34
  exports.ProgressBarComp = ProgressBarComp;
35
- class LabelComp extends core_1.ComponentX {
35
+ class LabelComp extends BaseComponent_1.ComponentX {
36
36
  constructor() {
37
37
  super(...arguments);
38
38
  this.size = 64;
@@ -71,13 +71,13 @@ class LabelComp extends core_1.ComponentX {
71
71
  }
72
72
  }
73
73
  exports.LabelComp = LabelComp;
74
- class ScrollView extends core_1.ComponentX {
74
+ class ScrollView extends BaseComponent_1.NoRenderComponentX {
75
75
  }
76
76
  exports.ScrollView = ScrollView;
77
- class BlockInputEventsComp extends core_1.NoRenderComponentX {
77
+ class BlockInputEventsComp extends BaseComponent_1.NoRenderComponentX {
78
78
  }
79
79
  exports.BlockInputEventsComp = BlockInputEventsComp;
80
- class ProgressTimerComp extends core_1.ComponentX {
80
+ class ProgressTimerComp extends BaseComponent_1.ComponentX {
81
81
  getFillRange() {
82
82
  return this.node.instance.progress;
83
83
  }
@@ -90,7 +90,7 @@ class ProgressTimerComp extends core_1.ComponentX {
90
90
  }
91
91
  }
92
92
  exports.ProgressTimerComp = ProgressTimerComp;
93
- class RichTextComp extends core_1.ComponentX {
93
+ class RichTextComp extends BaseComponent_1.ComponentX {
94
94
  getString() {
95
95
  return this.string;
96
96
  }
@@ -99,16 +99,28 @@ class RichTextComp extends core_1.ComponentX {
99
99
  }
100
100
  }
101
101
  exports.RichTextComp = RichTextComp;
102
- class LabelOutlineComp extends core_1.NoRenderComponentX {
102
+ class LabelOutlineComp extends BaseComponent_1.NoRenderComponentX {
103
103
  }
104
104
  exports.LabelOutlineComp = LabelOutlineComp;
105
- class LabelShadowComp extends core_1.NoRenderComponentX {
105
+ class LabelShadowComp extends BaseComponent_1.NoRenderComponentX {
106
106
  }
107
107
  exports.LabelShadowComp = LabelShadowComp;
108
- class InputComp extends core_1.ComponentX {
108
+ class InputComp extends BaseComponent_1.ComponentX {
109
109
  constructor() {
110
110
  super(...arguments);
111
111
  this.size = 64;
112
112
  }
113
113
  }
114
114
  exports.InputComp = InputComp;
115
+ class ListComp extends BaseComponent_1.ComponentX {
116
+ }
117
+ exports.ListComp = ListComp;
118
+ class SliderComp extends BaseComponent_1.ComponentX {
119
+ }
120
+ exports.SliderComp = SliderComp;
121
+ class RadioGroupComp extends BaseComponent_1.ComponentX {
122
+ }
123
+ exports.RadioGroupComp = RadioGroupComp;
124
+ class CheckBoxComp extends BaseComponent_1.ComponentX {
125
+ }
126
+ exports.CheckBoxComp = CheckBoxComp;
@@ -21,7 +21,6 @@ export declare class NodeComp<C extends Container = Container> implements BaseNo
21
21
  children: NodeComp[];
22
22
  actionsList: Animation[];
23
23
  name: string;
24
- private lastMove;
25
24
  private _group;
26
25
  onTouchStart?: TouchEVentCallback;
27
26
  onTouchMove?: TouchEVentCallback;
@@ -47,7 +46,6 @@ export declare class NodeComp<C extends Container = Container> implements BaseNo
47
46
  get anchorX(): number;
48
47
  set anchorX(val: number);
49
48
  get anchorY(): number;
50
- ß: any;
51
49
  set anchorY(val: number);
52
50
  /** rotation is in radians */
53
51
  get rotation(): number;
@@ -73,7 +71,7 @@ export declare class NodeComp<C extends Container = Container> implements BaseNo
73
71
  set zIndex(val: number);
74
72
  get childrenCount(): number;
75
73
  addComponent<T extends ComponentType>(instance: any): T;
76
- getComponent<T extends ComponentType>(component: Constructor<T>): T;
74
+ getComponent<T extends Constructor<ComponentType>>(component: T): InstanceType<T>;
77
75
  getComponentsInChildren<T extends ComponentType>(component: Constructor<T>): T[];
78
76
  getComponentInChildren<T extends ComponentType>(component: Constructor<T>): T;
79
77
  convertToNodeSpace(point: Point): Point;
@@ -1 +1 @@
1
- {"version":3,"file":"NodeComp.d.ts","sourceRoot":"","sources":["../../src/components/NodeComp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,SAAS,CAAA;AACtE,OAAO,EAAE,MAAM,EAAiB,SAAS,EAAE,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AC,KAAK,EAAE,KAAK;IAIlC,WAAW,IAAI,KAAK;IAIpB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM;IAUzC,WAAW,CAAC,GAAG,EAAE,MAAM;IAIvB,WAAW;IAoBX,cAAc,IAAI,IAAI;IAiBtB,QAAQ,CAAC,KAAK,EAAE,KAAK;IAKrB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAKxC,SAAS,CAAC,GAAG,EAAE,MAAM;IAKrB,cAAc;IAOd,eAAe;IAMf,gBAAgB;IAMhB,OAAO;IAaP,gBAAgB;IAMhB,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM;IAQzC,kBAAkB;IAMlB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,GAAG;IAS1D,GAAG,CAAC,IAAI,EAAE,MAAM;IAIhB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG;IAMjC,gBAAgB,CAAC,SAAS,EAAE,iBAAiB,CAAC,QAAQ,CAAC;IAWvD,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;IAG1B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;CAG/B"}
@@ -42,6 +42,7 @@ class NodeComp {
42
42
  this.data = {};
43
43
  this.children = [];
44
44
  this.actionsList = [];
45
+ // private lastMove: { x: number; y: number }
45
46
  this._group = 0;
46
47
  this.entity = entity;
47
48
  this.instance = instance;
@@ -318,6 +319,7 @@ class NodeComp {
318
319
  }
319
320
  }
320
321
  resolveComponent(component) {
322
+ // console.log(component.constructor.name, (component.constructor as any).hasRender)
321
323
  if (component.constructor.hasRender) {
322
324
  this.addChild(component.node);
323
325
  }
@@ -1,12 +1,11 @@
1
- import { ComponentX } from '@safe-engine/core';
2
1
  import { ColorSource, Graphics, Point, Sprite, TextureSource } from 'pixi.js';
3
2
  import { LoadingBar, LoadingBarMode } from '../core/LoadingBar';
4
3
  import { SpriteTypes } from '../systems/RenderSystem';
5
- import { NodeComp } from './NodeComp';
6
- export declare class NodeRender extends ComponentX<NodeComp> {
4
+ import { ComponentX } from './BaseComponent';
5
+ export declare class NodeRender extends ComponentX {
7
6
  nodeName?: string;
8
7
  }
9
- export declare class SpriteRender extends ComponentX<NodeComp<Sprite>> {
8
+ export declare class SpriteRender extends ComponentX<Sprite> {
10
9
  spriteFrame: TextureSource;
11
10
  type: SpriteTypes;
12
11
  fillType: LoadingBarMode;
@@ -17,12 +16,12 @@ export declare class SpriteRender extends ComponentX<NodeComp<Sprite>> {
17
16
  getSpriteFrame(): TextureSource<any>;
18
17
  setSpriteFrame(frame: any): void;
19
18
  }
20
- export declare class GraphicsRender extends ComponentX<NodeComp<Graphics>> {
19
+ export declare class GraphicsRender extends ComponentX<Graphics> {
21
20
  lineWidth: number;
22
21
  strokeColor: ColorSource;
23
22
  fillColor: ColorSource;
24
23
  }
25
- export declare class MaskRender extends ComponentX<NodeComp> {
24
+ export declare class MaskRender extends ComponentX {
26
25
  type: number;
27
26
  segments: number;
28
27
  inverted: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"RenderComponent.d.ts","sourceRoot":"","sources":["../../src/components/RenderComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAW,aAAa,EAAE,MAAM,SAAS,CAAA;AAEtF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,qBAAa,UAAW,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AW,CAAA;IACjB,QAAQ,EAAE,cAAc,CAAqB;IAC7C,SAAS,SAAI;IACb,UAAU,EAAE,KAAK,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IAQtB,YAAY,CAAC,GAAG,EAAE,MAAM;IAMxB,cAAc;IAId,cAAc,CAAC,KAAK,KAAA;CAkBrB;AAED,qBAAa,cAAe,SAAQ,UAAU,CAAC,QAAQ,CAAC;IACtD,SAAS,SAAI;IACb,WAAW,EAAE,WAAW,CAAA;IACxB,SAAS,EAAE,WAAW,CAAA;CACvB;AAED,qBAAa,UAAW,SAAQ,UAAU;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;CAClB"}
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MaskRender = exports.GraphicsRender = exports.SpriteRender = exports.NodeRender = void 0;
4
- const core_1 = require("@safe-engine/core");
5
4
  const pixi_js_1 = require("pixi.js");
6
5
  const LoadingBar_1 = require("../core/LoadingBar");
7
- class NodeRender extends core_1.ComponentX {
6
+ const BaseComponent_1 = require("./BaseComponent");
7
+ class NodeRender extends BaseComponent_1.ComponentX {
8
8
  }
9
9
  exports.NodeRender = NodeRender;
10
- class SpriteRender extends core_1.ComponentX {
10
+ class SpriteRender extends BaseComponent_1.ComponentX {
11
11
  constructor() {
12
12
  super(...arguments);
13
13
  this.fillType = LoadingBar_1.LoadingBarMode.BAR;
@@ -46,13 +46,13 @@ class SpriteRender extends core_1.ComponentX {
46
46
  }
47
47
  }
48
48
  exports.SpriteRender = SpriteRender;
49
- class GraphicsRender extends core_1.ComponentX {
49
+ class GraphicsRender extends BaseComponent_1.ComponentX {
50
50
  constructor() {
51
51
  super(...arguments);
52
52
  this.lineWidth = 2;
53
53
  }
54
54
  }
55
55
  exports.GraphicsRender = GraphicsRender;
56
- class MaskRender extends core_1.ComponentX {
56
+ class MaskRender extends BaseComponent_1.ComponentX {
57
57
  }
58
58
  exports.MaskRender = MaskRender;
@@ -0,0 +1,7 @@
1
+ import { EnhancedComponent } from '@safe-engine/core';
2
+ import { NodeComp } from './NodeComp';
3
+ export declare class SceneComponent extends EnhancedComponent<NodeComp> {
4
+ static boot: () => void;
5
+ static create(): SceneComponent;
6
+ }
7
+ //# sourceMappingURL=Scene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../src/components/Scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,MAAM,mBAAmB,CAAA;AAGhE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,qBAAa,cAAe,SAAQ,iBAAiB,CAAC,QAAQ,CAAC;IAC7D,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,CAAA;IACvB,MAAM,CAAC,MAAM;CASd"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SceneComponent = void 0;
4
+ const core_1 = require("@safe-engine/core");
5
+ const app_1 = require("../app");
6
+ const NodeComp_1 = require("./NodeComp");
7
+ class SceneComponent extends core_1.EnhancedComponent {
8
+ static create() {
9
+ const world = core_1.GameWorld.Instance;
10
+ world.entities.reset();
11
+ const root = world.entities.create();
12
+ const node = root.assign(new NodeComp_1.NodeComp(app_1.app.stage, root));
13
+ const sceneComponent = root.assign(new SceneComponent());
14
+ sceneComponent.node = node;
15
+ return sceneComponent;
16
+ }
17
+ }
18
+ exports.SceneComponent = SceneComponent;
@@ -1,7 +1,3 @@
1
- export declare function Color4B(r: number, g: number, b: number, a: number): {
2
- r: number;
3
- g: number;
4
- b: number;
5
- a: number;
6
- };
1
+ import { Color } from 'pixi.js';
2
+ export declare function Color4B(r: number, g: number, b: number, a: number): Color;
7
3
  //# sourceMappingURL=Color.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../src/core/Color.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;;;;;EAEjE"}
1
+ {"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../src/core/Color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,SAEjE"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Color4B = Color4B;
4
+ const pixi_js_1 = require("pixi.js");
4
5
  function Color4B(r, g, b, a) {
5
- return ({ r, g, b, a });
6
+ return new pixi_js_1.Color({ r, g, b, a });
6
7
  }
@@ -0,0 +1,13 @@
1
+ import { EnhancedComponent, GameWorld } from '@safe-engine/core';
2
+ import { Constructor, EntityManager, EventManager, EventReceive } from 'entityx-ts';
3
+ import { Point } from 'pixi.js';
4
+ export declare function v2(x?: number, y?: number): Point;
5
+ export declare function getDistance(point1: Point, point2: Point): number;
6
+ export declare function registerSystem<T extends EnhancedComponent<any>>(component: Constructor<T>): {
7
+ new (): {
8
+ configure(event_manager: EventManager<GameWorld>): void;
9
+ receiveComponentAddedEvent(event: EventReceive<T>): void;
10
+ update(entities: EntityManager, events: EventManager<GameWorld>, dt: number): void;
11
+ };
12
+ };
13
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/helper/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAsB,MAAM,YAAY,CAAC;AACxG,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,wBAAgB,EAAE,CAAC,CAAC,SAAI,EAAE,CAAC,SAAI,SAE9B;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,UAIvD;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,iBAAiB,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;;iCAK7D,YAAY,CAAC,SAAS,CAAC;0CAKd,YAAY,CAAC,CAAC,CAAC;yBAMhC,aAAa,UAAU,YAAY,CAAC,SAAS,CAAC,MAAM,MAAM;;EAe9E"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.v2 = v2;
4
+ exports.getDistance = getDistance;
5
+ exports.registerSystem = registerSystem;
6
+ const core_1 = require("@safe-engine/core");
7
+ const entityx_ts_1 = require("entityx-ts");
8
+ const pixi_js_1 = require("pixi.js");
9
+ const NodeComp_1 = require("../components/NodeComp");
10
+ function v2(x = 0, y = 0) {
11
+ return new pixi_js_1.Point(x, y);
12
+ }
13
+ function getDistance(point1, point2) {
14
+ const dx = point2.x - point1.x;
15
+ const dy = point2.y - point1.y;
16
+ return Math.sqrt(dx * dx + dy * dy);
17
+ }
18
+ function registerSystem(component) {
19
+ if (core_1.GameWorld.Instance.systems.isRegistered(`${component.name}System`)) {
20
+ return;
21
+ }
22
+ class NewSystem {
23
+ configure(event_manager) {
24
+ console.log('configure registerSystem core', component.name);
25
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, component, this.receiveComponentAddedEvent.bind(this));
26
+ }
27
+ receiveComponentAddedEvent(event) {
28
+ const ett = event.entity;
29
+ const newComp = ett.getComponent(component);
30
+ newComp.node = ett.getComponent(NodeComp_1.NodeComp);
31
+ }
32
+ update(entities, events, dt) {
33
+ for (const entt of entities.entities_with_components(component)) {
34
+ const comp = entt.getComponent(component);
35
+ // console.log('comp', comp.constructor.name, typeof comp['update'] === 'function')
36
+ if (comp.node.active && typeof comp['update'] === 'function') {
37
+ comp['update'](dt);
38
+ }
39
+ }
40
+ }
41
+ }
42
+ Object.defineProperty(NewSystem, 'name', { value: `${component.name}System` });
43
+ core_1.GameWorld.Instance.systems.add(NewSystem);
44
+ core_1.GameWorld.Instance.systems.configureOnce(NewSystem);
45
+ core_1.GameWorld.Instance.listUpdate.push(NewSystem);
46
+ return NewSystem;
47
+ }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  export * from './app';
2
+ export * from './components/BaseComponent';
2
3
  export * from './components/GUIComponent';
3
4
  export * from './components/NodeComp';
4
5
  export * from './components/RenderComponent';
6
+ export * from './components/Scene';
7
+ export * from './core/Color';
5
8
  export * from './core/Size';
9
+ export * from './helper/utils';
6
10
  export * from './systems/GUISystem';
7
11
  export * from './systems/RenderSystem';
12
+ export * from '@safe-engine/core';
8
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA"}
package/dist/index.js CHANGED
@@ -15,9 +15,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./app"), exports);
18
+ __exportStar(require("./components/BaseComponent"), exports);
18
19
  __exportStar(require("./components/GUIComponent"), exports);
19
20
  __exportStar(require("./components/NodeComp"), exports);
20
21
  __exportStar(require("./components/RenderComponent"), exports);
22
+ __exportStar(require("./components/Scene"), exports);
23
+ __exportStar(require("./core/Color"), exports);
21
24
  __exportStar(require("./core/Size"), exports);
25
+ __exportStar(require("./helper/utils"), exports);
22
26
  __exportStar(require("./systems/GUISystem"), exports);
23
27
  __exportStar(require("./systems/RenderSystem"), exports);
28
+ __exportStar(require("@safe-engine/core"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/systems/GUISystem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EACL,YAAY,EAEZ,MAAM,EACP,MAAM,YAAY,CAAA;AAQnB,qBAAa,SAAU,YAAW,MAAM;IACtC,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,SAAS,CAAC;CAiEjD"}
1
+ {"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/systems/GUISystem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EACL,YAAY,EAEZ,MAAM,EACP,MAAM,YAAY,CAAA;AAQnB,qBAAa,SAAU,YAAW,MAAM;IACtC,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,SAAS,CAAC;CAmFjD"}
@@ -19,8 +19,8 @@ class GUISystem {
19
19
  // component.node = entity.assign(new NodeComp(node, entity))
20
20
  node.onPress.connect(() => {
21
21
  // console.log('onPress.connect')
22
- const scale = pixi_action_ease_1.ScaleTo.create(0.12, 1.2);
23
- const scaleDown = pixi_action_ease_1.ScaleTo.create(0.12, 1);
22
+ const scale = pixi_action_ease_1.ScaleTo.create(0.5, 1.2);
23
+ const scaleDown = pixi_action_ease_1.ScaleTo.create(0.5, 1);
24
24
  const seq = pixi_action_ease_1.Sequence.create(scale, pixi_action_ease_1.CallFunc.create(() => {
25
25
  if (Object.prototype.hasOwnProperty.call(component, 'onPress')) {
26
26
  component.onPress(component);
@@ -49,6 +49,24 @@ class GUISystem {
49
49
  const view = new ui_1.ScrollBox({ width, height });
50
50
  component.node = entity.assign(new __1.NodeComp(view, entity));
51
51
  });
52
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, GUIComponent_1.ListComp, ({ entity, component }) => {
53
+ const view = new ui_1.List();
54
+ component.node = entity.assign(new __1.NodeComp(view, entity));
55
+ });
56
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, GUIComponent_1.SliderComp, ({ entity, component }) => {
57
+ const { bg, slider, fill } = component;
58
+ const view = new ui_1.Slider({ bg, fill, slider });
59
+ component.node = entity.assign(new __1.NodeComp(view, entity));
60
+ });
61
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, GUIComponent_1.RadioGroupComp, ({ entity, component }) => {
62
+ const view = new ui_1.RadioGroup();
63
+ component.node = entity.assign(new __1.NodeComp(view, entity));
64
+ });
65
+ event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, GUIComponent_1.CheckBoxComp, ({ entity, component }) => {
66
+ const { style } = component;
67
+ const view = new ui_1.CheckBox({ style });
68
+ component.node = entity.assign(new __1.NodeComp(view, entity));
69
+ });
52
70
  event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, GUIComponent_1.InputComp, ({ entity, component }) => {
53
71
  const { bg, size = 48, fill } = component;
54
72
  const view = new ui_1.Input({ bg, textStyle: { fontSize: size, fill } });
@@ -38,8 +38,8 @@ class RenderSystem {
38
38
  }
39
39
  // node.texture.rotate = 8
40
40
  component.node = entity.assign(new __1.NodeComp(node, entity));
41
- // component.node.anchorX = 0.5
42
- // component.node.anchorY = 0.5
41
+ component.node.anchorX = 0.5;
42
+ component.node.anchorY = 0.5;
43
43
  });
44
44
  event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, RenderComponent_1.MaskRender, ({ component }) => {
45
45
  console.log('MaskRender', component);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@safe-engine/pixi",
3
- "version": "8.0.5",
3
+ "version": "8.1.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,10 +17,10 @@
17
17
  "license": "ISC",
18
18
  "dependencies": {
19
19
  "@pixi/ui": "^2.1.5",
20
- "entityx-ts": "^2.0.3",
21
- "@safe-engine/core": "1.0.3",
20
+ "entityx-ts": "latest",
21
+ "@safe-engine/core": "latest",
22
22
  "lodash": "^4.17.21",
23
- "pixi-action-ease": "^1.0.12",
23
+ "pixi-action-ease": "latest",
24
24
  "pixi.js": "^8.4.0"
25
25
  },
26
26
  "devDependencies": {