@rpgjs/tiledmap 5.0.0-alpha.8 → 5.0.0-beta.1

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.
@@ -3,15 +3,15 @@ import { createModule } from "@rpgjs/common";
3
3
  import { provideLoadMap } from "@rpgjs/client";
4
4
  import { TiledParser } from "./index3.js";
5
5
  import component from "./index4.js";
6
+ import { prepareTiledPhysicsData } from "./index5.js";
6
7
  const server = null;
7
8
  function provideTiledMap(options) {
8
- var _a;
9
9
  return createModule("TiledMap", [
10
10
  {
11
11
  server,
12
12
  client
13
13
  },
14
- (_a = provideLoadMap) == null ? void 0 : _a(async (map) => {
14
+ provideLoadMap?.(async (map) => {
15
15
  const response = await fetch(`${options.basePath}/${map}.tmx`);
16
16
  const mapData = await response.text();
17
17
  const parser = new TiledParser(mapData);
@@ -40,6 +40,7 @@ function provideTiledMap(options) {
40
40
  basePath: options.basePath
41
41
  }
42
42
  };
43
+ prepareTiledPhysicsData(obj, obj);
43
44
  if (options.onLoadMap) {
44
45
  await options.onLoadMap(map);
45
46
  }
@@ -1,6 +1,12 @@
1
1
  import { defineModule } from "@rpgjs/common";
2
+ import { prepareTiledPhysicsData } from "./index5.js";
2
3
  const client = defineModule({
3
- effects: []
4
+ componentAnimations: [],
5
+ sceneMap: {
6
+ onPhysicsInit(map, context) {
7
+ prepareTiledPhysicsData(context?.mapData, map);
8
+ }
9
+ }
4
10
  });
5
11
  export {
6
12
  client as default