Adding the ability to set the player's color outline via the scripting API

(currently not shared with the other players yet)
This commit is contained in:
David Négrier 2021-12-21 17:02:18 +01:00
parent e086f6dac0
commit 90f7287860
11 changed files with 282 additions and 9 deletions

View file

@ -106,3 +106,25 @@ Example :
```javascript
WA.player.onPlayerMove(console.log);
```
### Set the outline color of the player
```
WA.player.setOutlineColor(red: number, green: number, blue: number): Promise<void>;
WA.player.removeOutlineColor(): Promise<void>;
```
You can display a thin line around your player's name (the "outline").
Use `setOutlineColor` to set the outline and `removeOutlineColor` to remove it.
Colors are expressed in RGB. Each parameter is an integer between 0 and 255.
```typescript
// Let's add a red outline to our player
WA.player.setOutlineColor(255, 0, 0);
```
When you set the outline on your player, other players will see the outline too (the outline color is shared across
browsers automatically).
![](images/outlines.png)