From a344d8c2bcbc03032fe23154f768fd0517fbc364 Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Fri, 14 Jan 2022 12:38:16 +0100 Subject: [PATCH] api-camera docs update --- docs/maps/api-camera.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/maps/api-camera.md b/docs/maps/api-camera.md index 6a7fa2c2..f0974ad6 100644 --- a/docs/maps/api-camera.md +++ b/docs/maps/api-camera.md @@ -1,6 +1,32 @@ {.section-title.accent.text-primary} + # API Camera functions Reference +### Start following player + +```javascript +WA.camera.followPlayer(smooth: boolean): void +``` +Set camera to follow the player. Set `smooth` to true for smooth transition. + +### Set spot for camera to look at + +```javascript +WA.camera.set( + x: number, + y: number, + width?: number, + height?: number, + lock: boolean = false, + smooth: boolean = false, +): void +``` + +Set camera to look at given spot. +Setting `width` and `height` will adjust zoom. +Set `lock` to true to lock camera in this position. +Set `smooth` to true for smooth transition. + ### Listen to camera updates ```