change setViewport action to set for CameraAPI
This commit is contained in:
parent
17e9c3c586
commit
7ee41bad30
7 changed files with 24 additions and 20 deletions
|
@ -140,6 +140,10 @@ export class CameraManager extends Phaser.Events.EventEmitter {
|
|||
}
|
||||
this.camera.pan(focusOn.x, focusOn.y, duration, Easing.SineEaseOut, true, (camera, progress, x, y) => {
|
||||
this.waScaleManager.zoomModifier = currentZoomModifier + progress * zoomModifierChange;
|
||||
if (progress === 1) {
|
||||
// NOTE: Making sure the last action will be centering after zoom change
|
||||
this.camera.centerOn(focusOn.x, focusOn.y);
|
||||
}
|
||||
this.emit(CameraManagerEvent.CameraUpdate, this.getCameraUpdateEventData());
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1125,11 +1125,11 @@ ${escapedMessage}
|
|||
);
|
||||
|
||||
this.iframeSubscriptionList.push(
|
||||
iframeListener.cameraSetViewportStream.subscribe((cameraSetViewportEvent) => {
|
||||
const duration = cameraSetViewportEvent.smooth ? 1000 : 0;
|
||||
cameraSetViewportEvent.lock
|
||||
? this.cameraManager.enterFocusMode({ ...cameraSetViewportEvent }, undefined, duration)
|
||||
: this.cameraManager.setPosition({ ...cameraSetViewportEvent }, duration);
|
||||
iframeListener.cameraSetStream.subscribe((cameraSetEvent) => {
|
||||
const duration = cameraSetEvent.smooth ? 1000 : 0;
|
||||
cameraSetEvent.lock
|
||||
? this.cameraManager.enterFocusMode({ ...cameraSetEvent }, undefined, duration)
|
||||
: this.cameraManager.setPosition({ ...cameraSetEvent }, duration);
|
||||
})
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue