hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
66 lines (32 loc) • 1.06 kB
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 on desktop.
Use for: controlling when mouse input is captured. Do NOT use for: mobile devices (pointer lock has no effect).
**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>
True to lock the pointer, false to unlock it.
\*\*Requires:\*\* Player must be in a world.
\*\*Side effects:\*\* Emits `PlayerUIEvent.LOCK_POINTER`<!-- -->.
\*\*Category:\*\* Players
</td></tr>
</tbody></table>
**Returns:**
void
## Remarks
If unlocked, the player cannot use in-game mouse inputs until it is locked again.