merge setPosition and focusOn into setViewport
This commit is contained in:
parent
a1c96b0524
commit
d62b116e5d
9 changed files with 44 additions and 116 deletions
|
@ -254,14 +254,10 @@ export class CameraManager extends Phaser.Events.EventEmitter {
|
|||
);
|
||||
|
||||
this.camera.on("followupdate", () => {
|
||||
this.sendCameraUpdateEvent();
|
||||
this.emit(CameraManagerEvent.CameraUpdate, this.getCameraUpdateEventData());
|
||||
});
|
||||
}
|
||||
|
||||
private sendCameraUpdateEvent(): void {
|
||||
this.emit(CameraManagerEvent.CameraUpdate, this.getCameraUpdateEventData());
|
||||
}
|
||||
|
||||
private getCameraUpdateEventData(): CameraManagerEventCameraUpdateData {
|
||||
return {
|
||||
x: this.camera.worldView.x,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue