@safe-engine/pixi 8.7.1 → 8.7.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/README.md CHANGED
@@ -10,7 +10,7 @@ Safex is an open-source game engine written in TypeScript, combining the power o
10
10
  - **Powered by PixiJS:** Utilize PixiJS for high-performance 2D rendering.
11
11
  - **Component-based Architecture:** Easily manage game elements such as scenes, sprites, and animations.
12
12
  - **Asset Loading Support:** Quickly load images, sounds, and spritesheets.
13
- - All components must be extends from `ComponentX` and in `.tsx` ext
13
+ - All components must be extends from `ComponentX` or call `registerSystem(${className})`
14
14
  - `node` property represent node, and can pass properties to assign
15
15
  - Example `<SpriteRender node={{ xy: [5, 9] }} />`
16
16
  - `$ref` bind component with current class property as string
@@ -5,7 +5,7 @@ export declare const DynamicBody = 2;
5
5
  export declare const KinematicBody = 1;
6
6
  export declare const StaticBody = 0;
7
7
  export declare let box2D: typeof Box2D;
8
- export declare function initBox2d(): Promise<void>;
8
+ export declare function initBox2d(wasmUrl: any): Promise<void>;
9
9
  export declare function setColliderMatrix(colliderMatrix?: boolean[][]): void;
10
10
  export declare class PhysicsSystem implements System {
11
11
  world: Box2D.b2World;
@@ -1 +1 @@
1
- {"version":3,"file":"PhysicsSystem.d.ts","sourceRoot":"","sources":["../../src/box2d-wasm/PhysicsSystem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,YAAY,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,OAAO,EAAoC,IAAI,EAAE,MAAM,IAAI,CAAA;AAY3D,eAAO,MAAM,WAAW,IAAI,CAAA;AAC5B,eAAO,MAAM,aAAa,IAAI,CAAA;AAC9B,eAAO,MAAM,UAAU,IAAI,CAAA;AAC3B,eAAO,IAAI,KAAK,EAAE,OAAO,KAAK,CAAA;AAE9B,wBAAsB,SAAS,kBAE9B;AAED,wBAAgB,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M;IA0BjE,IAAI,OAAO,CAAC,GAAG,EAAE,IAAI,EAIpB;CACF"}
@@ -25,8 +25,19 @@ export const DynamicBody = 2;
25
25
  export const KinematicBody = 1;
26
26
  export const StaticBody = 0;
27
27
  export let box2D;
28
- export function initBox2d() {
28
+ export function initBox2d(wasmUrl) {
29
29
  return __awaiter(this, void 0, void 0, function* () {
30
+ if (wasmUrl) {
31
+ box2D = yield Box2DFactory({
32
+ locateFile: (path) => {
33
+ if (path.endsWith(".wasm")) {
34
+ return wasmUrl;
35
+ }
36
+ return path;
37
+ }
38
+ });
39
+ return;
40
+ }
30
41
  box2D = yield Box2DFactory();
31
42
  });
32
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@safe-engine/pixi",
3
- "version": "8.7.1",
3
+ "version": "8.7.2",
4
4
  "description": "safex pixi plugin",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",