workadventure
workadventure copied to clipboard
Set camera API could return a Promise
Now that we can pass a duration to the function: set(x: number, y: number, width?: number, height?: number, lock?: boolean, smooth?: boolean, duration?: number): void;
It could be great to be able to know when the camera is fully set (in order to execute some code just after that).
So we could do:
// duration of 10 seconds
await WA.camera.set(area.x, area.y, 1000, 1000, false, true, 10000);
// Do something after the camera is set