From 37950bc26532d94324ec63bf5ed848d18ed0df3c Mon Sep 17 00:00:00 2001 From: Erik Onarheim Date: Wed, 4 Dec 2024 22:28:50 -0600 Subject: [PATCH] chore!: remove deprecated `ex.Engine.goto(...)` --- CHANGELOG.md | 1 + src/engine/Engine.ts | 37 ------------------------------------- src/spec/CrossFadeSpec.ts | 2 +- src/spec/FadeInOutSpec.ts | 2 +- 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a93e790f4..0faf0f335 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Breaking Changes +- `ex.Engine.goto(...)` removed, use `ex.Engine.goToScene(...)` - `ex.GraphicsComponent.show(...)` removed, use `ex.GraphicsComponent.use(...)` - `ex.EventDispatcher` removed, use `ex.EventEmitter` instead. - `ex.Engine.getAntialiasing()` and `ex.Engine.setAntialiasing(bool)` have been removed, use the engine constructor parameter to configure `new ex.Engine({antialiasing: true})` or set on the screen `engine.screen.antialiasing = true` diff --git a/src/engine/Engine.ts b/src/engine/Engine.ts index a2d82920e..93f0cb23e 100644 --- a/src/engine/Engine.ts +++ b/src/engine/Engine.ts @@ -1394,43 +1394,6 @@ O|===|* >________________>\n\ } } - /** - * Changes the current scene with optionally supplied: - * * Activation data - * * Transitions - * * Loaders - * - * Example: - * ```typescript - * game.goToScene('myScene', { - * sceneActivationData: {any: 'thing at all'}, - * destinationIn: new FadeInOut({duration: 1000, direction: 'in'}), - * sourceOut: new FadeInOut({duration: 1000, direction: 'out'}), - * loader: MyLoader - * }); - * ``` - * - * Scenes are defined in the Engine constructor - * ```typescript - * const engine = new ex.Engine({ - scenes: {...} - }); - * ``` - * Or by adding dynamically - * - * ```typescript - * engine.addScene('myScene', new ex.Scene()); - * ``` - * @param destinationScene - * @param options - * @deprecated use goToScene, it now behaves the same as goto - */ - public async goto(destinationScene: WithRoot, options?: GoToOptions) { - await this.scope(async () => { - await this.director.goto(destinationScene, options); - }); - } - /** * Changes the current scene with optionally supplied: * * Activation data diff --git a/src/spec/CrossFadeSpec.ts b/src/spec/CrossFadeSpec.ts index b4ad8a23b..a3982e569 100644 --- a/src/spec/CrossFadeSpec.ts +++ b/src/spec/CrossFadeSpec.ts @@ -69,7 +69,7 @@ describe('A CrossFade transition', () => { ); engine.addScene('newScene', { scene, transitions: { in: sut } }); - const goto = engine.goto('newScene', { destinationIn: sut }); + const goto = engine.goToScene('newScene', { destinationIn: sut }); clock.step(1); await nextMicroTask(); clock.step(1); diff --git a/src/spec/FadeInOutSpec.ts b/src/spec/FadeInOutSpec.ts index 2eda12ec6..6a393ef51 100644 --- a/src/spec/FadeInOutSpec.ts +++ b/src/spec/FadeInOutSpec.ts @@ -48,7 +48,7 @@ describe('A FadeInOut transition', () => { ); engine.addScene('newScene', { scene, transitions: { in: sut } }); - const goto = engine.goto('newScene'); + const goto = engine.goToScene('newScene'); await TestUtils.flushMicrotasks(clock, 15); clock.step(500); await Promise.resolve();