hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
54 lines (26 loc) • 955 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [server](./server.md) > [PlayerUI](./server.playerui.md) > [lockPointer](./server.playerui.lockpointer.md)
## PlayerUI.lockPointer() method
Locks or unlocks the player's mouse pointer. If the pointer is unlocked with lockPointer(false), the player will not be able to use in-game inputs or camera controls from the mouse pointer until `player.ui.lockPointer(true)`<!-- -->, or in your game's client UI html with `hytopia.lockPointer(true)`<!-- -->.
**Signature:**
```typescript
lockPointer(lock: boolean): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
lock
</td><td>
boolean
</td><td>
Set true to lock the pointer, false to unlock it.
</td></tr>
</tbody></table>
**Returns:**
void