Skip to content

Commit

Permalink
chore!: remove deprecated ex.Engine.goto(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Dec 5, 2024
1 parent 196f780 commit 37950bc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 39 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
37 changes: 0 additions & 37 deletions src/engine/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TKnownScenes>, options?: GoToOptions) {
await this.scope(async () => {
await this.director.goto(destinationScene, options);
});
}

/**
* Changes the current scene with optionally supplied:
* * Activation data
Expand Down
2 changes: 1 addition & 1 deletion src/spec/CrossFadeSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/spec/FadeInOutSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 37950bc

Please sign in to comment.