Refactoring and documentation update
This commit is contained in:
parent
4356767739
commit
1e073d8a0e
7 changed files with 47 additions and 22 deletions
23
docs/maps/api-camera.md
Normal file
23
docs/maps/api-camera.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
{.section-title.accent.text-primary}
|
||||
# API Camera functions Reference
|
||||
|
||||
### Listen to the camera update
|
||||
|
||||
```
|
||||
WA.camera.onCameraUpdate(callback: WasCameraUpdatedEventCallback): void
|
||||
```
|
||||
|
||||
Listens to the updating of the camera linked to the player. It will trigger for every update of the camera's properties (position or scale for instance) or of the Game Object it is linked to (undestand: if the player moves). An event will then be sent.
|
||||
|
||||
The event has the following attributes :
|
||||
* **x (number):** coordinate X of the camera's world view (the area looked at by the camera).
|
||||
* **y (number):** coordinate Y of the camera's world view.
|
||||
* **width (number):** the width of the camera's world view.
|
||||
* **height (number):** the height of the camera's world view.
|
||||
|
||||
**callback:** the function that will be called when the camera is updated.
|
||||
|
||||
Example :
|
||||
```javascript
|
||||
WA.camera.onCameraUpdate((worldView) => console.log(worldView));
|
||||
```
|
|
@ -10,5 +10,6 @@
|
|||
- [UI functions](api-ui.md)
|
||||
- [Sound functions](api-sound.md)
|
||||
- [Controls functions](api-controls.md)
|
||||
- [Camera functions](api-camera.md)
|
||||
|
||||
- [List of deprecated functions](api-deprecated.md)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue