@duyquangnvx/pixi-game-engine 0.1.2 → 0.1.4

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/index.cjs CHANGED
@@ -1283,6 +1283,7 @@ var SceneManager = class {
1283
1283
  if (!SceneClass) {
1284
1284
  throw new Error(`Scene "${name}" not found`);
1285
1285
  }
1286
+ const previousName = this.currentSceneName;
1286
1287
  if (this.currentScene) {
1287
1288
  this.currentScene.onExit();
1288
1289
  Engine.stage.removeChild(this.currentScene);
@@ -1293,6 +1294,7 @@ var SceneManager = class {
1293
1294
  this.currentSceneName = name;
1294
1295
  Engine.stage.addChild(scene);
1295
1296
  await scene.onEnter();
1297
+ Engine.onSceneChange.emit({ from: previousName, to: name });
1296
1298
  }
1297
1299
  /** Get current scene name */
1298
1300
  get current() {
@@ -2382,6 +2384,8 @@ var Engine = class _Engine {
2382
2384
  static onVisibilityChange = new Signal();
2383
2385
  /** Signal emitted when browser window gains/loses focus (true = focused, false = blurred) */
2384
2386
  static onFocusChange = new Signal();
2387
+ /** Signal emitted when scene changes (payload: { from: previous scene name or null, to: new scene name }) */
2388
+ static onSceneChange = new Signal();
2385
2389
  /** Design resolution width (original config width) */
2386
2390
  static _designWidth;
2387
2391
  /** Design resolution height (original config height) */
@@ -2610,7 +2614,9 @@ var Engine = class _Engine {
2610
2614
  _Engine.onDestroy.clear();
2611
2615
  _Engine.onVisibilityChange.clear();
2612
2616
  _Engine.onFocusChange.clear();
2617
+ _Engine.onSceneChange.clear();
2613
2618
  _Engine._app.destroy(true, { children: true, texture: true });
2619
+ PIXI10.Assets.reset();
2614
2620
  _Engine._isRunning = false;
2615
2621
  _Engine._initialized = false;
2616
2622
  }