Merge pull request #1730 from thecodingmachine/camera-api-docs-update
api-camera docs update
This commit is contained in:
commit
6269ba997b
@ -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
|
||||
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user