merge setPosition and focusOn into setViewport

This commit is contained in:
Hanusiak Piotr 2022-01-13 16:08:16 +01:00
parent a1c96b0524
commit d62b116e5d
9 changed files with 44 additions and 116 deletions

View file

@ -17,17 +17,17 @@ export class WorkAdventureCameraCommands extends IframeApiContribution<WorkAdven
}),
];
public setPosition(x: number, y: number, width: number, height: number, smooth: boolean = false): void {
public setViewport(
x: number,
y: number,
width: number,
height: number,
lock: boolean = false,
smooth: boolean = false
): void {
sendToWorkadventure({
type: "cameraSetPosition",
data: { x, y, width, height, smooth },
});
}
public focusOn(x: number, y: number, width: number, height: number, smooth: boolean = false): void {
sendToWorkadventure({
type: "cameraFocusOn",
data: { x, y, width, height, smooth },
type: "cameraSetViewport",
data: { x, y, width, height, lock, smooth },
});
}