Skip to content

0.29.0-alpha.884+e397cbb

@eonarheim eonarheim tagged this 29 Jan 17:25
This PR enables scene specific input APIs that only fire handlers when the scene is active! This is very useful if you have a lot of handlers to manage and don't want to keep track of engine level subscriptions.

```typescript
class SceneWithInput extends ex.Scene {
  onInitialize(engine: ex.Engine<any>): void {
    this.input.pointers.on('down', () => {
      console.log('pointer down from scene1');
    });
  }
}
class OtherSceneWithInput extends ex.Scene {
  onInitialize(engine: ex.Engine<any>): void {
    this.input.pointers.on('down', () => {
      console.log('pointer down from scene2');
    });
  }
}
```

https://github.com/excaliburjs/Excalibur/assets/612071/b6759145-d45b-4212-92a6-d0a4f8ff990b
Assets 2
Loading